basic commands Flashcards Preview

command line > basic commands > Flashcards

Flashcards in basic commands Deck (31):
1

echo

print screen(-n = do not print)

2

pwd

show location

3

what is the anatomy of a command

[command][arguments...]

4

tar

an archival command that can archive, compress, and extract files, but to make it work, you need to tell it which files to take action on, and what exactly to do with those files

5

tar -c -z -f

create zip file(flags)

6

[man][command]

show the manual of a certain command

7

cd

change current directory

8

ls

see what's in a directory

9

cd ~

go to home directory

10

mkdir

make a directory in current location

11

[touch][filename.example]

create a new file

12

mv

move or rename a file. example:
[mv][filename][newname]
[mv][source][destination]
[mv][filename][location]
[mv][subfolder/file][newname](will rename file and move it to current folder)

13

rm

remove a file

14

rm -r

remove a folder and all its contents

15

cat

print out all the contents of a file

16

head

print the first few lines of a file

17

tail

print the last few lines of a file

18

more

print out the contents of a file, but only fill one screen's worth at a time

19

less

The less command allows you to go forward one line with the down arrow, backward one line with the up arrow, and backward and forward a page with the page up and page down keys. You can also use the space bar in the same way you can with the more command

20

/

root directory

21

.

current directory

22

..

one level up

23

../..

two levels up

24

*

The "splat" or "glob" operator. This is the wildcard of the command line and represents "any characters"

25

cp

Copy one or more files to a new location

26

touch

Create a new file or update modification time if a file with that name exists

27

mkdir -p

create a nest of directories

28

which

To figure out a default executable's location

29

env

You can see exactly what variables have been set,

30

ls -a

show hidden files

31

$PATH

show the path to a file