Professional Documents
Culture Documents
Linux CLI: January 8, 2021 1:37 PM
Linux CLI: January 8, 2021 1:37 PM
Linux CLI: January 8, 2021 1:37 PM
• File/Dir Manipulation
○ pwd - present work directory
○ mkdir, rmdir, mv, cp, rm - file/dir manipulation
../ -> refers to directory above pwd
. -> current dierctory
eg: mv ../ file* . -> moves all files starting with name 'file' from parent directory to
current directory
○ touch - update, date/time stamp of file
if file doesn’t exist, creates it
○ globbing - using wild characters to access group of files
file* - all files starting with 'file' and any character after that
file? - all files starting with 'file' and one character after that
○ locate - to locate a file anywhere in the system
updatedb - to update the file index before using locate
○ cat - display file contents
actually concatenates and then displays multiple files
○ grep - search/filter file content
combined with | for more utility
□ cat /etc/groups | grep ubuntu
○ >>/> /</<< - redirect contents to a file
> - to create new file or replace existing file with same name
>> - append existing file, else create new
Linux Page 1
latest.tar.gz - archive named 'latest' is a tar archive compressed using gz algorithm
tar xzf latest.tar.gz
□ c/x - compress/decompress
□ z - ziped file
□ f - filename follows immediately
○ unzip - for zip archives
○ gzip - when z option is dropped in tar - less compression
○ bzip - uses Burrows-Wheeler transform compression algo
Linux Page 2