Utilities Flashcards

1
Q

ls -l

A

Lists the names of files

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

cat [filename]

A

Displays a text file

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

rm [-if] [filename]

A

Deletes a file
i prompts you for removal
f forces removal

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

hostname

A

Displays the system name

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

cp [source file] [destination file]

A

copies a file

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

mkdir [directory name]

A

Creates a new directory

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

rmdir [directory name]

A

Deletes a directory

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

rm *

A

Deletes everything in current directory

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

cd or cd ~

A

Takes user to home directory

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

mv [existing file name] [new filename]

A

Changes the name of a file; can also move files to a different directory

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

lpr -P [printer name] [filename(s)]

A

Prints file to certain printer

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

grep

A

Searches for a string

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

head [-number] [filename]

A

Displays the first number lines of file

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

tail [-f] [filename]

A

Monitors lines as they are added to the end of the growing file filename

tail displays end of a file

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

sort [filename[

A

Displays a file in order

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

uniq [filename]

A

Removes duplicate lines from a file

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

diff -u [file1] [file2]

A

Compares two files by breaking long, multiline text into hunks

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

file [filename]

A

Identifies contents of files

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

ln -s [directory 1] [directory 2]

A

Creates a symbolic link

20
Q

|

A

Known as pipeline

Takes the standard output of one process and sends that output as the input of the second process

21
Q

wc -w [filename or directory]

A

Displays the number of words in a file or number of files in directory

22
Q

echo ‘String’ > [filename]

A

echo displays text

> means redirection

23
Q

date

A

Displays time and date

24
Q

script

A

Records shell session

Usually save session in file named typescript

25
Q

!/bin/sh

A

This should always start in the first column in the first row of a shell file (i.e. at the very beginning of the file)

26
Q

unix2dos

A

Converts Linux files to Windows and Mac OS X format

27
Q

dos2unix

A

Converts Windows files to Linux files

28
Q

dos2mac

A

Converts Mac OS X files to Linux files

29
Q

bzip2 -v [filename]

A

Compresses a file, file is renamed with a .bz2 extension

  • v causes bzip2 to report how much it was able to redce the size of the file
  • k keeps the original file

Can compress tar files; usually have .tar.bz2 extension

30
Q

bunzip2

A

Restores a file that has been compressed with bzip2

31
Q

bzcat

A

Displays a file that has been compressed with bzip2

32
Q

gzip

A

Compresses a file; less efficient than bzip2 and files are marked with .gz extension

Can compress tar files as well; usually have .tar.gz extension

33
Q

tar -ctxvf [tar file] [filename(s)]

A

Packs and unpacks archives

Creates a single file called a tar file from multiple files or directory hierarchies and to extract files from a tar file

  • c create -v verbose -f write to and read from file
  • t displays table of contents -x extracts files from tar archive
34
Q

which, whereis

A

Locates utilities
whereis uses standard locations instead of your search path to find a binary file, manual pages, source code
which uses search path

35
Q

locate [filename]

A

Searches for files on the local system

36
Q

who

A

Lists users on the system, terminal line identification, last login date and time

37
Q

finger

A

Lists users on the system, location user logged in from, full name of user, user supplied vanity information

38
Q

uptime

A

Displays system load and duration information

39
Q

w

A

Lists users on the system

Also displays last command executed, system uptime and load average, CPU time used, login time (for day-old logins)

40
Q

chmod -R [permission] [directory or filename]

A

Assigns permissions to directory or file

41
Q

free

A

Displays memory usage information

42
Q

write [receiving user]

A

Sends a message to user

43
Q

mesg [y or n]

A

Denies or accepts messages

44
Q

touch

A

Creates empty file

45
Q

vim

A

Edits files from another directory