SDSU Faculty Profile - Victor M. Ponce - UNIX Primer - Summary of UNIX Commands

Dr. Victor Miguel Ponce

UNIX PRIMER
(Version 020913)


  • Use lower case letters only.
  • To release console, follow any command by ampersand symbol (Example: emacs myfile.html&).
  • myfile.txt~ is the previously saved copy of myfile.txt
  • .cshrc is the name of the dot-c-shell-run-command file in default (home) directory
  • To suspend a foreground job, type CTRL-Z.

UNIX CommandAction
alias h 'history'sets h as alias to history command
cat myfile.htmldisplays myfile.html, stopping at end-of-file
cat myfile.html | moredisplays myfile.html, a page-at-a-time by pressing Spacebar, a line-at-a-time by pressing Return
cdsteps up to default (home) directory
cd ..steps up one directory level
cd ../xyz changes to directory xyz at same level
cd directoryxsteps down one directory level to directoryx
cd /usr/local/apachechanges to directory /usr/local/apache
chmod a+rwx abcadds read/write/execute capabilities to user, group, and others on file abc
chmod g+w abcadds write capability to group on file abc
chmod o+r abcadds read capability to others on file abc
chmod u+x abcadds execute capability to user on file abc
chmod o-r abcremoves read capability to others on file abc
chmod o-wx abcremoves write and execute capability to others on file abc
chmod 444 abcdeadds read capability to user, group, and others on file abcde
chmod 555 abcdeadds read and execute capability to user, group, and others on file abcde
chmod 666 abcdeadds read and write capability to user, group, and others on file abcde
chmod 655 abcdeadds read and write capability to user and read and execute capability to group and others on file abcde
chmod 700 abcdeadds read, write and execute capability to user and removes all capabilities for group and others on file abcde
chmod 777 abcdeadds read, write and execute capability to user, group, and others on file abcde
convert -border 8 -bordercolor darkkhaki
-raise 8 a.jpg ab.jpg
convert a.jpg image to ab.jpg image which has an 8-pixel-colored (darkkhaki) 8-pixel-raised border
convert_im -border 8 -bordercolor darkkhaki
-raise 8 a.jpg ab.jpg
convert a.jpg image to ab.jpg image which has an 8-pixel-colored (darkkhaki) 8-pixel-raised border (attila server)
cp a.html b.htmlcopies a.html into b.html
datedisplays calendar date and time
du -aprints number of 512-byte blocks in use by each directory
emacs myfile.htmlinvokes Edit-MACroS editor to edit myfile.html
find myfi*lists all files starting with myfi in current directory and all others below it
find . -type d -printlists all directory files in current directory
find . -type d -print | morelists all directory files in current directory, a page-at-a-time by pressing Spacebar, a line-at-a-time by pressing Return
find $home -type d -printlists all directory files in home directory
find $home -type d -print | morelists all directory files in home directory, a page-at-a-time by pressing Spacebar, a line-at-a-time by pressing Return
find /usr/local/apache/htdocs/ponce -name '*.htm*' -exec chmod 0 {} \;Disables browsing
ftp hostnameto transfer files to and from remote hostname
f77 myfile.f -o myfilecompiles myfile.f and creates executable myfile under Fortran77
f90 myfile.f -o myfilecompiles myfile.f and creates executable myfile under Fortran90
grep abcglobally find regular expression abc and print
historylists history of n commands previously run on terminal window; n set in .cshrc
history -rlists history of commands in reverse order
history 10lists last 10 commands, instead of the n set in .cshrc
jobslists active jobs
kill 1234terminates process 1234, listed by ps -f -u ownerx shown below
limitshow current limits on shell processes such as cputime
ln abc.html a.htmlcreates a pseudonym a.html for existing file abc.html
logoutterminates the login shell (closes the terminal window)
lp myfile.pssends 1 copy of postscript file myfile.ps to defaulf printer
lp -n 5 myfile.pssends 5 copies of postscript file myfile.ps to default printer
lp -d lex myfile.pssends 1 copy of postscript file myfile.ps to destination printer lex
lprm jonesremoves all jones jobs queued on default printer
lpstat -dshow the default printer destination
lslists current directory
ls -alists directory including hidden files, preceded with period (.)
ls -llists current directory showing protection, owner, size, and date
ls -l | morelists current directory, a page-at-a-time by pressing Spacebar, a line-at-a-time by pressing Return
ls -al | grep abclists current directory, including hidden files (a), and link with (pipe |) grep abc (globally find regular expression abc and print)
ls *xyz.*lists all files with name ending string 'xyz', in current directory
mkdir protected12creates subdirectory protected12 in current directory
more myfile.htmldisplays beginning of myfile.html, then, a page-at-a-time by pressing Spacebar, a line-at-a-time by pressing Return
mv abc.html def.htmlrenames abc.html as def.html
mv abc.html /usr/jonesmoves abc.html into subdirectory /usr/jones
ps -f -u userxreports active processes in full (f) only (u) for userx
ps -ef | grep sshglobally find regular expression ssh and print
pwdprints (displays) working (current) directory
rehashrefreshes terminal window to operate newly installed software
rm bde.htmlremoves (deletes) bde.html
scp aaa.f hostname:makes a secure copy of file aaa.f in root directory of hostname
scp -r aaa name:aaabackmakes a secure copy of subdirectory aaa in subdirectory aaaback of host name
source .cshrcexecutes .cshrc file
ssh hostnamesecure shell (login) to hostname (requires username and password)
ssh -l groupmember localhostsecure shell (login) to groupmember on local host (requires username and password)
ssh attila.sdsu.edu -l jonessecure shell (login) to user jones in attila.sdsu.edu (requires password)
strings modelr.res | lp -d ps231bremoves binary strings from modelr.res and prints to printer labeled ps231b
su - groupmemberswitch (login) to groupmember (requires password)
telnet hostnamecommunicate with hostname using telnet (requires username and password)
time myfileexecutes myfile and shows time usage
unlimit cputimechanges cputime on current shell to unlimited
wholists users currently logged into the system
whois abc.comqueries domain name database for ownership/status of abc.com
xemacs myfile.htmlinvokes eXtended Edit-MACroS editor to edit myfile.html
!12executes command no. 12 listed by the history command



link to link to link to link to
image of

Aerospace | Civil | Electrical | Mechanical | Search