Soc Linux Cheatsheet
Soc Linux Cheatsheet
File Permissions
chmod octal file – change the permissions of file to octal, which can be found separately for user, group, and
world by adding:
• 4 – read (r)
• 2 – write (w)
• 1 – execute (x)
Examples:
chmod 777 – read, write, execute for all
chmod 755 – rwx for owner, rx for group and world
Help commands
Command Action
progname --help or progname -h displays help/usage for program – if provided
man progname displays documentation for progname
man -k progname searches all documentation containing progname
System commands
Command Action
date shows the current date and time
cal show this month's calendar
whoami who you are logged in as
df show quota information/disk usage
which progname shows path information for progname
Short cuts
Command Action
Ctrl+C halts current command
Ctrl+D logout, similar to exit
Ctrl+U erases line of input at command line
!! repeats last command
history displays history of commands with number of command
!# repeats # of command from history,
Example: !76 will repeat the 76th command in history
up arrow displays last command, continually pressing up arrow will allow to scroll
through previous commands
tab auto complete
Remote Access
Command Action
ssh $USER@$HOST open a secure shell connection as $USER at $HOST
ssh -Y $USER@$HOST open a secure shell connection as $USER at $HOST allowing to run X11
tunneling
scp $USER@$HOST: file dir/ secure copy a file to $HOST as $USER