Utilities Flashcards

(45 cards)

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
#!/bin/sh
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
unix2dos
Converts Linux files to Windows and Mac OS X format
27
dos2unix
Converts Windows files to Linux files
28
dos2mac
Converts Mac OS X files to Linux files
29
bzip2 -v [filename]
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
bunzip2
Restores a file that has been compressed with bzip2
31
bzcat
Displays a file that has been compressed with bzip2
32
gzip
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
tar -ctxvf [tar file] [filename(s)]
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
which, whereis
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
locate [filename]
Searches for files on the local system
36
who
Lists users on the system, terminal line identification, last login date and time
37
finger
Lists users on the system, location user logged in from, full name of user, user supplied vanity information
38
uptime
Displays system load and duration information
39
w
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
chmod -R [permission] [directory or filename]
Assigns permissions to directory or file
41
free
Displays memory usage information
42
write [receiving user]
Sends a message to user
43
mesg [y or n]
Denies or accepts messages
44
touch
Creates empty file
45
vim
Edits files from another directory