linux commands Flashcards

(21 cards)

1
Q

man

A

An online manual

> man grep

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

ls

A

List directory contents
– Similar to the dir command in Windows

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

pwd

A

Print Working Directory
– Displays the current working directory path
– Useful when changing directories often

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

mv

A

Move a file or rename a file

mv SOURCE DEST
> mv first.txt second.txt

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

cp

A

Copy a file - Duplicate files or directories

cp SOURCE DEST
> cp first.txt second.txt

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

rm

A

Remove files or directories - Deletes the files
Does not remove directories by default
– Directories must be empty to be removed or
must be removed with -r

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

chown

A

Change file owner and group - Modify file settings

sudo chown [OWNER:GROUP] file
> sudo chown professor script.sh

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

sudo

A

– Execute a command as the super user or user ID
– Only that command executes as the super user

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

su

A

– Become super user or change to a different user
– You continue to be that user until you exit

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

chmod

A

Change mode of a file system object
– r=read, w=write, x=execute
– Can also use octal notation
– Set for the file owner (u), the group(g),
others(o), or all(a)

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

apt-get

A

Advanced Packaging Tool
– Handles the management of application packages
– Applications and utilities
* Install, update, remove
> sudo apt-get install wireshark

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

yum

A

Yellowdog Updater, Modified (yum) -
Install, delete, update
Manages RPM packages
– Red Hat Package Manager - RPM Package Manager
– A Linux distribution will commonly use either
yum or apt-get

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

ip

A

Manage the network interfaces
– Enable, disable, configure addresses,
manage routes, ARP cache, etc.
* ip address
– View interface addresses
* ip route
– View the IP routing table
* sudo ip address add 192.168.121.241/24 dev eth0
– Configure the IP address of an interface

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

df

A

Disk Free - View file systems and free space
* df
– View number of blocks
* df -h
– View human-readable sizes

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

grep

A

Find text in a file
– Search through many files at a time

grep PATTERN [FILE]
> grep failed auth.log

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

ps

A

View the current processes
– And the process ID (PID)
– Similar to the Windows Task Manager
View user processes
ps
View all processes
ps -e | more

17
Q

top

A

View CPU, RAM, and resource utilizations
– The “Task Manager” for Linux
Process information
– Easy to find the highly utilized applications
Summary of overall load
– One, five, and fifteen minutes
Many different options
– Check the man page for startup options and keys

18
Q

find

A

Find a file by name or extension
– Search through any or all directories
Find files with a specific extension
> find . -name “*.txt”

19
Q

dig

A

Lookup information from DNS servers
– Canonical names, IP addresses, cache timers, etc.
dig (Domain Information Groper)
– Detailed domain information

20
Q

cat

A

Concatenate - Link together in a series
Copy a file/files to the screen
cat file1.txt file2.txt
Copy a file/files to another file
cat file1.txt file2.txt > both.txt

21
Q

nano

A

Full-screen text editor - Easy to edit
Included with many Linux distributions - Easy to install
Select, mark, copy/cut, and paste text
– Similar features to graphical-based editors