OSX terminal Flashcards
This command prints the location of your current working directory.
pwd
Used to print contents of a directory, by default it lists contents of current working directory
ls
move around with
cd
to print the contents of a file to the screen(
cat
copy files and directories with this command
cp
command is used to move or rename directories and files
mv
command is used to remove directory or files.
rm
used to make a new directory in linux
mkdir
remove a directory,
rmdir
Linux command allows you to run programs or other commands with administrative privileges
sudo
Takes you to the root directory.
cd/
Takes you up one directory level
cd..
Takes you to the previous directory
cd-
Removes an empty directory.
rmdir (“remove directory”) –
Removes a directory along with its content.
rm -r (“remove recursively”) –
command displays all of your previous commands up to the history limit.
history
command displays information about the disk space usage of all mounted filesystems.
df
command displays the size of a directory and all of its subdirectories.
du
Displays the amount of free space available on the system.
free
Provides a wide range of basic information about the system.
uname -a
Displays the processes using the most system resources at any given time. “q” can be used to exit.
top
how to exit from top command?
q
command displays a “manual page”
man
Move cursor to beginning of line
Ctrl + A
Move cursor to end of line
Ctrl + E
Clears the entire current line
Ctrl + U
Clears the command from the cursor right
Ctrl + K
Delete the word before the cursor
Ctrl + W
Allows you to search your history for commands matching what you have typed
Ctrl + R
Kill the current process
Ctrl + C
Suspend the current process by sending the signal SIGSTOP
Ctrl + Z
Clears the terminal output
Ctrl + L
Move forward one word
Alt + F
Move backward one word
Alt + B
Copy the highlighted command to the clipboard
Ctrl + Shift + C
Paste the contents of the clipboard
Ctrl + Shift + V or Shift + Insert
Used to complete the command you are typing. If more than one command is possible, you can press it multiple times to scroll through the possible completions.
tab
a shortcut to home directory
~
tilday key
formatted listing with hidden files
ls -al
delete file
rm ‘filename’
display your currently active processes
ps
show the current date and time
date
show this month’s calendar
cal