Basic Linux Commands Flashcards

1
Q

ls - List directory contents - Basic Linux Commands

A

• Lists files, directories
• For long output, pipe through more: > ls -l | more
(use q or Ctrl-c to exit)

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

grep - Find a text in a file - Basic Linux Commands

A
  • grep PATTERN [FILE]

* > grep failed auth.log

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

cd - Change current directory - Basic Linux Commands

A
  • Nearly identical to Windows command line
  • Forward slashes instead of backward
  • cd
  • > cd /var/log
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

shutdown - Shut the system down - Basic Linux Commands

A
  • sudo shutdown 2
    • Shuts down and turns o the computer in two minutes
  • sudo shutdown -r 2
    • Shuts down and reboots in two minutes
  • Ctrl-C to cancel
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

pwd - Print Working Directory - Basic Linux Commands

A
  • 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
6
Q

passwd - Change a user account password - Basic Linux Commands

A

• passwd [username]

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

mv - Move (rename) a file - Basic Linux Commands

A
  • mv SOURCE DEST

* > mv first.txt second.txt

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

cp - Copy a file - Basic Linux Commands

A
  • cp SOURCE DEST

* > cp rst.txt second.txt

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

rm - Remove files or directories - Basic Linux Commands

A
  • Does not remove directories by default

* Directories must be empty or must be removed with -r

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

mkdir - Make a directory - Basic Linux Commands

A
  • mkdir DIRECTORY

* > mkdir notes

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

chmod - Change mode of a file system object - Basic Linux Commands

A
  • 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)
  • chmod mode FILE
  • > chmod 744 script.sh
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

chown - Change file owner and group - Basic Linux Commands

A
  • 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
13
Q

iwconfig - View or change wireless network configuration - Basic Linux Commands

A
  • Requires some knowledge of the wireless network

* iwconfig eth0 essid studio-wireless

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

ifconfig - View or configure a interface and IP configuration - Basic Linux Commands

A

•ifconfig eth0

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

ps - View the current process - Basic Linux Commands

A
  • Similar to the Windows Task Manager
  • View user processes - ps
  • View all processes - ps -e | more
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

su - Become a super user - Basic Linux Commands

A

• You continue to be that user until you exit

17
Q

sudo - Execute a command as the super user - Basic Linux Commands

A

• Only that command executes as the super user

18
Q

apt-get - Advanced Packaging tool - Basic Linux Commands

A
  • Handles the management of application packages

* > sudo apt-get install wireshark

19
Q

vi - Visual mode editor - Basic Linux Commands

A
  • Full screen editing with copy, paste, and more
  • vi FILE
  • > vi script.sh
  • Insert text - i
  • Exit insert mode with Esc
  • Save (write) the file and quit vi - :wq
20
Q

dd - Convert and copy a file - Basic Linux Commands

A
  • Backup and restore an entire partition
  • > dd if= of= [Options] • Creating a disk image
  • > dd if=/dev/sda of=/tmp/sda-image.img
  • Restoring from an image
  • > dd if=/tmp/sda-image.img of=/dev/sda