Command line: Difference between revisions

21 bytes removed ,  14 February 2009
no edit summary
No edit summary
No edit summary
Line 65: Line 65:
  username@computername:~$_
  username@computername:~$_


This (especially the dollar sign) is called the so called "prompt", where ''username'' should be the name of the currently logged on user and ''computername'' is the name of your computer.
This (especially the dollar sign) is the so called "prompt", where ''username'' should be the name of the currently logged on user and ''computername'' is the name of your computer.


Note the "~" (tilde) sign before the prompt. On Linux systems that sign indicates, that your in your home directory, which normally should be equal to "/home/username".
Note the "~" (tilde) sign before the prompt. On Linux systems that sign indicates, that you're in your home directory, which normally should be equal to "/home/username".


On Linux systems, you can chance directories equally to the above described Windows method:
On Linux systems, you can chance directories equally to the above described Windows method:
Line 92: Line 92:


  username@computername:~$ cd /any/path/you/like
  username@computername:~$ cd /any/path/you/like
  username@computername:any/path/you/likehome$ cd /home/username
  username@computername:/any/path/you/like$ cd /home/username
  username@computername:~$ cd /some/other/path
  username@computername:~$ cd /some/other/path
  username@computername:/some/other/path$ cd ~
  username@computername:/some/other/path$ cd ~
Line 116: Line 116:
  OpenSceneGraph                run_fgjs.sh~
  OpenSceneGraph                run_fgjs.sh~


Okay. Imagine, you just want to know about the files and directories containing the sequence "run". In order to achieve this, you can pass the output of the "ls" command to another program. A very common filter program is "grep". You use "grep" by telling the program what to filter. Directing the output of "ls" to "grep" (filtering for "run") is by using the ''pipe'' symbol: "|"
Okay. Imagine, you just want to know about the files and directories containing the sequence "run". In order to achieve this, you can pass the output of the "ls" command to another program. A very common filter program is "grep". You use "grep" by telling the program what to filter. Directing the output of "ls" to "grep" (filtering for "run") is done by using the ''pipe'' symbol: "|"


  username@computername:~/flightgear$ ls | grep run
  username@computername:~/flightgear$ ls | grep run
Line 161: Line 161:
  drwxr-xr-x  3 username usergroupname  4096 2009-01-26 07:20 simgear
  drwxr-xr-x  3 username usergroupname  4096 2009-01-26 07:20 simgear


Firts, every item has its mode bit, shown on the very left in a scheme of "drwxrwxrwx", followed by a number, the username of the owner (should be the same as of the current user!), the name of the group of the current user, the file size, its last change date and its name. If there is a "-", the specifiy mode bit isn't set.
First, every item has its mode bit, shown on the very left in a scheme of ''drwxrwxrwx'', followed by a number, the username of the owner (should be the same as of the current user!), the name of the group of the owner, file size, its last change date and its name. If there is a "-", the specific mode bit isn't set.


The first "d" in some of the items indicates a directory. Then, three groups of "rwx" follow. Each "r" means "file/directory may be read", each "w" means "file/directory may be written", each "x" means "file may be executed". The first group of "rwx" shows the rights of the owner of the file, the next group of "rwx" shows the rights of the group of the owner and the last group gives information about what everybody may do with the file.
The first ''d'' in some of the items indicates a directory. Then, three groups of ''rwx'' follow. Each ''r'' means "file/directory may be read", each ''w'' means "file/directory may be written", each ''x'' means "file may be executed".  
 
The first group of ''rwx'' shows the rights of the owner of the file, the next group of "rwx" shows the rights of the group of the owner and the last group of "rwx" gives information about what everybody may do with the file.


As there are some scripts out there, that can be downloaded, you have to make them executable in most of the cases (because downloading only sets "-rw-r--r--" per default). Making a file executable can be achieved by the "chmod" command. We use the "ls" command with its "-l" option and the ''pipe'' to filter the output of "ls" by "grep":
As there are some scripts out there, that can be downloaded, you have to make them executable in most of the cases (because downloading only sets "-rw-r--r--" per default). Making a file executable can be achieved by the "chmod" command. We use the "ls" command with its "-l" option and the ''pipe'' to filter the output of "ls" by "grep":
Line 180: Line 182:
==External links==
==External links==
* [https://help.ubuntu.com/community/UsingTheTerminal?action=show&redirect=BasicCommands Ubuntu wiki page on the command line]
* [https://help.ubuntu.com/community/UsingTheTerminal?action=show&redirect=BasicCommands Ubuntu wiki page on the command line]
==Development==
Windows Vista?


[[Category:Howto]]
[[Category:Howto]]
51

edits