Understanding command syntax -II
There are times when an argument is associated with an option. In that case, the argument must immediately follow the option. With single-letter options, the argument typically follows after a space.
An example of a single-letter option that is followed by an argument:
$ tar -cvf backup.tar /home/chris
In the tar example just shown, the options say to create (c) a file (f) named backup.tar that includes all the contents of the /home/chris directory and its subdirectories and show verbose messages as the backup is done (v). Because backup.tar is an argument to the f option, backup.tar must immediately follow the option.
Here are a few commands you can try out. See how they behave differently with different options.
$ uname
Linux
$ uname -a
Linux myhost.example.com 2.6.32-131.17.1.el6.x86_64 #1 SMP Thu Sep 29 10:24:25 EDT 2011 x86_64 x86_64 x86_64 GNU/LinuxLinux
$ date
Sun Dec 4 09:08:38 EST 2011
$ date +'%d/%m/%y'
04/12/11
$ date +'%A, %B %d, %Y'
Sunday, December 04, 2011
When you log in to a Linux system, Linux views you as having a particular identity, which includes your username, group name, user ID, and group ID. Linux also keeps track of your login session: It knows when you logged in, how long you have been idle, and where you logged in from. To find out information about your identity, use the id command as follows:
$ id
uid=501(chris) gid=501(chris) groups=105(sales), 7(lp)
In this example, the username is chris, which is represented by the numeric user ID (uid) 501. The primary group for chris also is called chris, which has a group ID (gid) of 501. It is normal for Fedora and Red Hat Enterprise Linux users to have the same primary group name as their username. The user chris also belongs to other groups called sales (gid 105) and lp (gid 7). These names and numbers represent the permissions that chris has to access computer resources.
Comments
Post a Comment