Linux Admin Basics Flashcards

List fundamental commands for admins that install and integrate applications in Linux

1
Q

Handling files

  1. Create [file/directory]
  2. Copy [file/directory]
  3. Copy to a remote system
  4. Move/Cut&Paste [file/directory]
  5. Delete [file/directory]
  6. Close [file]
A
  1. a. cat [myfile.txt] or touch [myfile.txt]
    b. mkdir [directory]
  2. a. cp [source file] [destination file&directory]
    b. cp -r [source directory] [destination directory]
  3. scp OR sftp
  4. a. mv [source file] [destination]
  5. a. rm [myfile.txt]
    b. rm -r dir [directory] OR rmdir (removes empty directory)
  6. q
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Command line

  1. View all including hidden directory contents
  2. Browse directories
    a. current directory
    b. parent directory
  3. View current directory
A
  1. ls -la
  2. cd
    a. .
    b. ..
  3. pwd
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Searching

  1. Search for file or directory
  2. Search for a string in a file
  3. Go up a page within file
  4. Go down a page within a file
A
  1. find [file or directory] OR locate [file or directory]
  2. grep -i [keyword]
  3. ctrl + b
  4. space bar
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Show

  1. Show file
  2. Show last 10 lines of file
  3. Show text output of e.g. env. variable
  4. Show processes
  5. Show all previously run commands
  6. Show disk usage
A
  1. cat [file.txt]
  2. tail [file.txt]
  3. Echo [env. var]
  4. a.ps -e (shows all processes) OR top
    b. ps - u [username] (shows processes of named user)
  5. history
  6. du -k or du -h
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Compressing and Archiving

  1. Create a collection of files and directories in one file> archiving
  2. Reduce/compress file size
  3. Uncompress
A
  1. a. tar - c [file] (archives file> file.tar)
    b. tar - x [file] (unarchives a file)
  2. gzip [file] (creates> file.gzip)
    tar -z [file]
    tar -cz (archives&zips file creating> file.tgz)
  3. gunzip [file.gz]
    tar -zxf file.tar.gz
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Install / Uninstall

  1. Install packages in RPM
  2. Delete packages in RPM
  3. a Find available packages
  4. List installed packages
  5. Install packages in Debian
  6. Remove packages in Debian
A
  1. yum install [package in directory]
  2. yum remove [package in directory]
  3. a yum search [name of package]
  4. rpm -qa
  5. a. apt install [package in directory]
    b. dpkg [package] (installs local package)
  6. apt remove (package in directory)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Moving files to remote systems

  1. Transfer files
  2. Transfer files and view remote directories
  3. Graphical clients
A
  1. pscp [options] [user@]host:source target
    a. Putty secure client scp
    b. Download PSCP.EXE from Putty download page.
    c. Open command prompt and type set PATH=
    d. In command prompt point to the location of the pscp.exe using cd command.
    e. Type pscp.
    f. Use the following command to copy file form remote server to the local system
    pscp [options] [user@]host:source target.
  2. Use secure ftp:
    a. sftp [remote-system IP] (login to remote syste)
    b. cd [target-directory] (change to remote directory)
    c. ls -l (confirm you have read permissions for file)
    d. get [filename] (copy file)
    e. bye (end connection)
  3. a. WinSCP
    b. FileZilla
    d. Cyberduck
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Environment Variables

  1. Show all env var
  2. Show where a particular env. var is located
  3. Set env. var
  4. Remove an env var
  5. Make env var. persist after startup
A
  1. printenv
  2. echo $[env var]
  3. a. cd [directory of env var]
    b. [env var]=[target env path]
  4. unset [env var]
  5. Go to one of the three locations and edit the file:
    /etc/environment&raquo_space;> JAVA_PATH=/usr/local/java
    /etc/.bashrc&raquo_space;> export PATH=”$JAVA_PATH:$PATH”
    ~/.pam_environment&raquo_space;>PATH DEFAULT=/usr/bin:usr/local/bin
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Linux Directory

/bin
/sbin
/etc
/home
/opt
/tmp
/usr
/var
/cdrom
/mnt
/proc

** potential logs for third party software

A

/bin – executable files aka essential binaries
/sbin – system binaries
/etc ** – host specific system config
/home – home directories
/opt **
– config file for third party application software
>bin
>etc
>lib
>log
/tmp – temporary files deleted on boot
/usr ** – sharable and read only files
>bin
>etc
>lib
>log
/var **
– var. data files generated by system or vendor
/cdrom – mount point for CDs
/mnt – mount point f external file systems
/proc – running processes

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

Attach a folder/directory to a home directory

Remove the attached directory

A

> mount [mountable folder] [destination directory]

> umount [mounted folder]

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