IT Share NVP -ViettechgroupVN-Phuong Nguyen blog | Share make us stronger Knowledge is Sharing Viettechgroup- Sharing Make Us Stronger-Kiến thức CNTT là sự chia sẻ- NVP-Chia sẻ làm chúng ta mạnh hơ| ITShareNVP Channel | Phương Nguyễn | Phuong Nguyen Blog| Lưu trữ kiến thức chia sẽ kinh nghiệm CNTT | Phương Nguyễn

Linux commands and shell scripting notes-P1

0 404

Useful Linux commands

  • How many users are logged in: who
  • Who is the current user: whoami
  • Print the date: date
  • Show calendar: cal
  • Print working directory: pwd
  • Print files and directory of the current directory: ls
  • Manual help: man whoami
  • Create a new directory: mkdir directoryname
  • Create a new empty file: touch filename
  • Remove a directory: rmdir directoryname
  • Remove a file: rm filename
  • Remove a directory and its content: rm -r directoryname
  • Display list of available commands: help
  • Clear terminal: clearctrl+l
  • Exit session: “exit`
  • Display date: date
  • Display time: time
  • Print information: hello
  • Increase the font size: Ctrl, shift and +
  • Print 5 random numbers between 1 and 100: shuf -i 1-100 -n 5
  • Creating file using the shuf command: touch dir$(shuf -i 1-10 -n 1)/sunny.txt
  • Simple user: $ prompt
  • Root user/admin: # prompt
  • Switch from simple user to root user: sudo -i
  • Switch from root to simple user: exit

This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish. AcceptRead More