Supp - 2. Unix Shell Basics¶
Objectives πΆβπ«οΈ
- Navigate your file system using the command line.
- Quick recap on commands used in routine tasks such copy, move, remove.
It is expected that you are already familiar with using the basics of the Unix Shell. As a quick refresher, some frequently used commands are listed below.
For more information about a command, use the Unix man
(manual) command. For example, to get more information about the mkdir
command, type:
Key commands for navigating around the filesystem are:
ls
- list the contents of the current directoryls -l
- list the contents of the current directory in more detailpwd
- show the location of the current directorycd DIR
- change directory to directory DIR (DIR must be in your current directory - you should see its name when you typels
OR you need to specify either a full or relative path to DIR)cd -
- change back to the last directory you were incd
(alsocd ~/
) - change to your home directorycd ..
- change to the directory one level above
Other useful commands:
mv
- move files or directoriescp
- copy files or directoriesrm
- delete files or directoriesmkdir
- create a new directorycat
- concatenate and print text files to screenmore
- show contents of text files on screenless
- cooler version ofmore
. Allows searching (use/
)tree
- tree view of directory structurehead
- view lines from the start of a filetail
- view lines from the end of a filegrep
- find patterns within files