- -l (long format)
- -a (list . files too)
- -r (reverse order)
- -t (newest appears first)
- -d (do not go beyond current directory)
- -i (show inodes)
Helpful keys for pg:
- 1 (go to top)
- $ (go to bottom)
- h (help)
- / (Search)
- ? (Search back)
- q (quit)
- -1 (back a page)
$ pwd
/usr/live/data/epx/vss2
To change the current working directory use cd
$ cp /etc/hosts /etc/hosts.backup # make a backup of the hosts file
$ cp /etc/motd /tmp/jon/ # Copy file /etc/motd to directory /tmp/jon/
Options
- -f (to force the copy to occur)
- -r (to recursively copy a directory)
- -p (to attempt to preserve permissions when copying)
$ mv /tmp/jon/handycommands.txt . # move handycommands in /tmp/jon to current directory
$ mv -f vihelp vihelp.txt # Move file vihelp to vihelp.txt (forced)
Options
- -f (to force the move to occur)
- -r (to recursively move a directory)
- -p (to attempt to preserve permissions when moving)
.
$ rm /tmp/jon/*.unl # remove all *.unl files in /tmp/jon
$ rm -r /tmp/jon/usr # remove all files recursively Options
- -f (to force the removal of the file)
- -r (to recursively remove a directory)
$ du /etc # list recursively all directories off /etc
712 /etc/objrepos
64 /etc/security/audit
536 /etc/security
104 /etc/uucp
8 /etc/vg
232 /etc/lpp/diagnostics/data
240 /etc/lpp/diagnostics
248 /etc/lpp
16 /etc/aliasesDB
16 /etc/acct
8 /etc/ncs
8 /etc/sm
8 /etc/sm.bak
4384 /etc The sizes displayed are in 512K blocks. To view this in 1024K blocks use the option -k
$ lp /etc/motd # send file /etc/motd to default printer
$ cat /etc/motd # display file /etc/motd to screen
*******************************************************************************
* *
* *
* Welcome to AIX Version 4.1! *
* *
* *
* Please see the README file in /usr/lpp/bos for information pertinent to *
* this release of the AIX Operating System. *
* *
* *
******************************************************************************* cat is also useful for concatenating several files. e.g.
$ cat fontfile IN* > newfile # appends fontfile and all files beginning with IN to newfileThough this might seem an essentially useless command, because most unix commands always take a filename argument, it does in fact come in extremely useful at more advanced levels. Awards are given out occasionally for the most useless usage of cat. If an option of '-' is specified, cat will take its input from stdin.
No comments:
Post a Comment