Useful linux commands for Ubuntu users

Like some other operating systems Ubuntu provides users with a nice and flexible graphics system. However, in addition to using the graphics that the operating system provides, we can work with Ubuntu through commands.

If on the Windows command line window is called Command Prompt then on Ubuntu is called Terminal.

To start the terminal in Ubuntu LTS 14.04 you can use 1 of 2 ways:

  • Method 1: Go to Dash home menu, in the search bar you type "Terminal" and you can see Terminal appears below as shown below:

9e1a1219e6e443684c49eaf36a7f20b539fbb9c3

  • Method 2: Alternatively, you can press "Ctrl + Alt + T" to open Terminal directly

Below is the first interface of Terminal when appears

00a446feafb3a54e814c935f81640aa9fabe2ce7

Inside:

  • Tran.viet.ha is the username that is logged in
  • framgia006 is the hostname
  • ~: only you are in your home directory, it will change to / when you are in the root directory
  • $: you are using normal user rights, when you use root permissions to install software or change the system, $ will change to #

The following are the basic commands to manipulate Termnial:

1 – System management

  • kill: stop proccess when suspended. Only super-user can stop all processes and another user can only stop proccess that user created.
  • passwd: change the password for the user
  • groups: displays the current user group
  • who: indicates who is logged in the system
  • useradd: create a new user
  • userdel: delete the user created
  • clear: clear the command line window.
  • date: view system date and time.
  • find / usr / share / zoneinfo / | grep -i pst: see Timezone.
  • ln -f -s / usr / share / zoneinfo / Asia / Ho_Chi_Minh / etc / localtime: Change Server Time to Timezone Vietnam.
  • date -s "1 Oct 2009 18:00:00": change the system time.
  • cal: see the system calendar.

2 – Check information:

  • cat / proc / cpuinfo: Find the specifications of the CPU
  • cat / proc / meminfo: Memory and information exchange page
  • lspci: See the mainboard information
  • uname -r: See version kernel
  • / sbin / ifconfig: See your IP addresses
  • netstat: see all connections
  • netstat -an | grep: 80 | wc -l: see how many connections to port 80.
  • last: see log login to the system.
  • history: see log command.
  • df: See the disk space.
  • free -m: see memory capacity.

3 – Operating the system:

  • exit: exit the terminal.
  • logout: similar exit.
  • reboot: reboot the system.
  • mount: mount the file system from a storage device to the main directory tree.
  • umount: as opposed to the mount command.

4 – Working with File and Folder

  • ls: get a list of all the files and folders in the current folder.
  • pwd: export the path of the working folder.
  • cd: change the working folder to a new folder.
  • mkdir: create a new folder.
  • rmdir: delete the empty folder.
  • cp: copy one or more files to the new folder.
  • mv: rename or move files, folders.
  • rm: delete file.
  • wc: count lines, characters … in file.
  • touch: create file.
  • cat: view file contents.
  • en: start the micro text editor.
  • tar -cvzpf archive.tgz / home / example / public_html / folder: compress a folder
  • tar -tzf backup.tar.gz: list gz archive file.
  • tar -xvf archive.tar: extract a tar file.
  • unzip file.zip: unzip the .zip file
  • wget: download file.

The above are some of the basic commands that are very useful for newcomers to the Ubuntu operating system. To understand and use the above commands well, you should use the man command with the syntax: man ten_cau_lenh to get complete information about the function and syntax of the command.

Reference source

ITZone via Viblo

Share the news now