Linux Command line

จาก Wiki2

ข้ามไปที่: นำทาง, สืบค้น

เนื้อหา

Link

How to enter shell

  • Terminal Program
  • Virtual Console
    Hold down key Ctrl+Alt and press F2 or F4 or F5
    and exit by type "exit" or F7
    • Hold down key Ctrl+Alt + Arrow key left or right to move around
  • Booting into the shell
    In order to start GUI type "startx"

How to log in to root user

  1. sudo su
  2. or sudo -i

Please note your prompt will be "#", in order to exit type "exit"

prompt

  • "<user name>@<computer name>: path $" such as "jk@jk:~$"
  • "~" = home directory
  • $ = ordinary user prompt while, # = root user

OS Variable

  • Linux store all data in variable and you can see it by command "echo" for ex: "echo $PATH"

Run Program

  • To run program in current directory "./myprogram" use dot follow by slash.

Get help of the command

  • <command> --help
  • man <command>
  • info <command>
  • whatis <command>
  • whereis <command> look where is the command and help file
  • whereis command—Returns the location of the command and its man page.
  • whatis command—Returns a one-line synopsis from the command’s man page.
  • locate file—Returns locations of all matching file(s); an extremely fast method of searching your system because locate searches a database containing an index of all files on your system.
  • apropos subject—Returns a list of commands related to subject.

List of Hardware

$sudo lshw

$sudo lshw -C disk

$sudo lshw -html > your-file-name.html

Hardware List 29 may 2009 21:30

USB Microphone

Run file manager as root

jk@jk:~$ sudo nautilus

Check current director

pwd

Look for the file

locate <file/directory name>

  • look for all director for file namd "httpd.conf"
    • sudo find / -name httpd.conf
รับข้อมูลจาก "http://www.noklek.com/wiki2/index.php/Linux_Command_line"
เครื่องมือส่วนตัว