This document provides summaries of common Linux commands for handling files, directories, compression/archives, searching, redirection, job control, printing and networking. It lists commands for creating, deleting, moving within and displaying contents of directories and files. Commands are given for compressing/extracting archives, searching for files, redirecting output, managing running processes, sending jobs to printers and configuring network interfaces.
This document provides summaries of common Linux commands for handling files, directories, compression/archives, searching, redirection, job control, printing and networking. It lists commands for creating, deleting, moving within and displaying contents of directories and files. Commands are given for compressing/extracting archives, searching for files, redirecting output, managing running processes, sending jobs to printers and configuring network interfaces.
Add read + write permissions to all users: Compressing su (switch user) chmod a+rw file su (keep same directory and environment) ls l Compress a file: Make executable files executable by all: gzip file (.gz format) List all the files in the current directory, chmod a+rX * bzip2 file (.bz2 format, better) Time management including “hidden” ones (starting with .): Wait for 60 seconds: ls a Make the whole directory and its contents Uncompress a file: sleep 60 accessible by all users: gunzip file.gz List by time (most recent files first): chmod R a+rX dir (recursive) bunzip2 file.bz2 Show the current date: ls t date List by size (biggest files first) Comparing files and directories Archiving Count the time taken by a command: ls S Comparing 2 files: Create a compressed archive (tape archive): time find_charming_prince cute rich List with a reverse sort order: diff file1 file2 tar zcvf archive.tar.gz dir/ ls r Comparing 2 files (graphical): tar jcvf archive.tar.bz2 dir/ (better) Command help Long list with most recent files last: gvimdiff file1 file2 Test (list) a compressed archive: Basic help (works for most commands): ls ltr tkdiff file1 file2 tar ztvf archive.tar.gz grep help kompare file1 file2