Docsity

Linux Basic Command Line, Summaries of Network and System Administration

Toggle sidebar
bg1
$ uname -a (display system information)
1.
$ screenfetch (display system information)
2.
$ rpm -qa centos-release (check your CentOS Version)
3.
$ cat /etc/centos-release (check your CentOS Version)
4.
$ hostnamectl (provide system information)
5.
$ whatis vim
a.
b.
$ whatis command
6.
$ man mkdir
a.
Press "q" to exit form man page
b.
$ man command
7.
$ info cp
a.
Press "q" to exit from info page
b.
$ info command
8.
$ Help (display all shell built-in commands)
9.
$ mkdir --help : will display the usage of command "mkdir" with its options
a.
$ rm --help | less : will show the usage of command "rm" and options with full screen display
b.
$ command --help (display brief usage of command with options)
10.
$ pwd (show your current directory)
11.
$ cd (change directory)
12.
$ ls -l /home
a.
$ ll /mnt/data
b.
$ ls -l or $ ll [argument]
13.
$ cp file_name [destination]
14.
Basic Command Line
Tuesday, January 5, 2021
8:25 AM
OS Update Page 1
pf3
pf4
pf5

Partial preview of the text

Download Linux Basic Command Line and more Summaries Network and System Administration in PDF only on Docsity!

1.$ uname - a (display system information)

  1. $ screenfetch (display system information)
  2. $ rpm - qa centos-release (check your CentOS Version)
  3. $ cat /etc/centos-release (check your CentOS Version)
  4. $ hostnamectl (provide system information) a. $ whatis vim In case you have problem with whatis command that always show result "nothing appropriate" you can type command $ mandb to solve this problem. (Only Root can do it) b.
  5. $ whatis command a. $ man mkdir b. Press "q" to exit form man page
  6. $ man command a. $ info cp b. Press "q" to exit from info page
  7. $ info command
  8. $ Help (display all shell built-in commands) a. $ mkdir --help : will display the usage of command "mkdir" with its options b. $ rm --help | less : will show the usage of command "rm" and options with full screen display
  9. $ command --help (display brief usage of command with options)
  10. $ pwd (show your current directory)
  11. $ cd (change directory) a. $ ls - l /home b. $ ll /mnt/data
  12. $ ls - l or $ ll [argument]
  13. $ cp file_name [destination] Basic Command Line Tuesday, January 5, 2021 8:25 AM

a.$ cp - r folder_name [destination]

  1. $ cp file_name [destination]
  2. $ mv file_name [destination]
  3. $ mv old_name new_name a. {..} example $ touch file{A..Z} (it will create files from fileA to fileZ in order) b. {,} example $ touch file{1,9} (it will create only file1 and file9)
  4. $ touch file_name a. $ rm - f file_names (force to remove, no asking) b. $ rm - rf directory_name
  5. $ rm (option) file_name
  6. $ rmdir directory_name (remove only empty directory) a. $ mkdir Learning Video Data b. $ mkdir Class{A..C} c. $ mkdir - p folder/subfolder

d. $ mkdir - p Drama/korea/The_king Drama/Thai/Flower

  1. $ mkdir (option) directory_name a. Press "i" : insert text/modify/delete text b. Press "Esc" > Press :wq! Or :x! (enter) => save and exit c. Press "Esc" > Press ZZ => save and exit d. Press "Esc" > Press :q! (enter) => exit without saving
  2. $ vim file_name (edit file) a. >> add more contents b. > overwrite on old contents
  3. $ echo "type what you want" >> file_name (add texts into file) a. To exit from less mode => Press "q" b. To search text within less mode => /text (enter)
  4. $ less file_name
  5. $ more file_name (cannot scroll up/down to view text, and cannot search text)

a.# userdel - f john : force to delete user "john", no asking message b. # userdel - r jane : delete user "jane" with her home directory c. # userdel - rf mike : force to delete his user and home directory at the same time a. $ hostnamectl set-hostname centos_pc

  1. $ hostnamectl set-hostname [name] (assign hostname to computer)
  2. $ init 6 : restart computer
  3. $ init 0 : shutdown computer
  4. $ ifconfig : check IP address information of computer
  5. $ history : display all commands that you already type from the past
  6. $ history | less : view history commands with less mode (full screen mode)
  7. $ history | grep yum : to display only commands that has matching word "yum" a. $ ping 192.168.1. b. $ ping google.com
  8. $ ping [IP/domain name]
  9. $ yum update (update packages on your system)
  10. $ yum update firefox (update only package firefox if it available to update) a. $ yum install htop b. $ yum install - y vim htop firefox epel-release snapd
  • d means "download only"
  • y means "yes, download and install"
  • n means "No, cancel the action" c. yum install question message:
  1. $ yum install [packages] a. $ yum remove firefox b. $ yum - y remove htop vim
  2. $ yum remove [packages] a. $ yum list available firefox (check only package "firefox" if it available on repository)
  3. $ yum list available (list all packages that are available to install on repository)

a.$ yum list installed firefox (list only firefox if is already installed)

  1. $ yum list installed (list all packages that already installed in the system) a. $ yum search firefox
  2. $ yum search [package] a. $ yum info firefox
  3. $ yum info [package] (display detail information about package that you installed on system)
  4. $ yum repolist : list all enabled repository in your system
  5. $ yum history : view all the past actions of yum command of each user
  6. $ yum clean all : clean unnecessary cache files from repository