Bash Commands List Flashcards
All of the bash commands defined in the bash commands list
pwd
Report the path for the present working directory (cur-
rent directory)
cat
Read one or more files and write them out one after
another to standard output (often used as a quick way
to look at the contents of a small file). Usage: cat file
or cat file1 file2 file3
ls
List files in the current direction. Usage: ls or ls path
ls -la
Long listing including all files
ls -R
List recursively for all subdirectories
who
Report who is logged in
pinky
Give information about a user. Usage pinky -l username
date
Report the system time
cd
Change current directory
mkdir
Make a directory
rm
Remove files
rm -r
remove directories
rm -i
remove interactive mode
cp
Copy one or more files. Usage: cp old file new file or
cp file1 file2 . . . directory
cp -r
Copies everything
mv
Move files to new filenames or new directories. Usage:
mv old name new name or cp file directory
mv -i
Prompt before overwriting anything
more
Display the contents of a file to the user one page at a
time. Pressing spacewill let yougo on to the next page.
Usage: more file
man
Provide online documentation for Unix commands, system calls, configuration files and other features. Usage:
man command name
head
Print the first ten lines of each file parameter (or from
stdin if no parameter is given). Usage: head file
head -n num
Print the first num lines of a file
Usage: head -n num filename
tail
Print the last ten lines of each file parameter (or from
stdin if no parameter is given). Usage: tail file
tail -n num
Print the last num lines of a file
touch
Bring the modification time of a file up to the current
time. Also, create an empty file if it doesn’t already
exist. Usage: touch file
touch -t
Sets modification time for a file to a specific time
Usage: touch -t [YY]YYMMDDHHMM[.ss] oldfile
ps
Show currently running processes
ps -e
Report every process