Basic Command Line Commands Flashcards
cd change directory ls list directory rmdir remove directory pushd push directory popd pop directory cp copy a file or directory mv move a file or directory less page through a file cat print the whole file xargs execute arguments find find files grep find things inside files man read a manual page apropos find what man page is appropriate env look at your environment echo print some arguments export export/set a new environment variable exit exit the shell su (28 cards)
1
Q
pwd
A
print working directory
2
Q
hostname
A
my computer’s network name
3
Q
mkdir
A
make directory
4
Q
cd
A
change directory
5
Q
ls
A
list directory
6
Q
rmdir
A
remove directory
7
Q
pushd
A
push directory
8
Q
popd
A
pop directory
9
Q
cp
A
copy file
10
Q
mv
A
move file directory
11
Q
less
A
page through a file
12
Q
cat
A
print a whole file
13
Q
xargs
A
execute arguments
14
Q
find
A
find files
15
Q
grep
A
find things inside files
16
Q
man
A
read a manual page
17
Q
apropos
A
find appropriate man page
18
Q
env
A
look at environment
19
Q
echo
A
print some arguments
20
Q
export
A
export/set a new environment variable
21
Q
exit
A
exit shell
22
Q
sudo
A
take over
23
Q
chmod
A
change permission modifiers
24
Q
chown
A
change ownership
25
$|$
The | takes the output from the command on the left, and "pipes" it to the command on the right.
26
$<$
The < will take and send the input from the file on the right to the program on the left.
27
$>$
The > takes the output of the command on the left, then writes it to the file on the right.
28
$>>$
The >> takes the output of the command on the left, then appends it to the file on the right.