CSE 314: Operating Systems
Sessional
Shell tips & tricks
Clear the screen
You can clear the screen with CTRL + L
Copy & Paste on shell
● CTRL+C & CTRL+V do not work in shell
● Double click (or select) something with a mouse to copy and click the
middle button to paste
Switch between directories
cd - => Changes the working directory to the previous working directory.
File extension does not matter
● In unix like operating systems, the OS does not determine file type from
file extension
● We can check a file type with the ‘ file’ command
Be careful with rm
Whenever you use wildcards with rm (besides carefully checking your
typing!), test the wildcard first with ls. This will let you see the files that will
be deleted. Then press the up arrow key to recall the command and replace
the ls with rm.
Good old history
You can view your command history with history command
To put a previous command in action you can get the number from history
and call it with a preceding !
Create a new text file
truncate a file (or create a new, empty file) we can use a trick like this:
> [Link]
Brace expansion
mkdir {2009..2011}-0{1..9} {2009..2011}-{10..12}