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

UNIX PRIMER
[110224]


  • Use lower case letters only.
  • To release console from the process, follow any command by an ampersand symbol (Example: emacs myfile.html&).
  • myfile.html~ is the previously saved copy of myfile.html
  • .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
cancel -a allcancels all printer jobs; then RESET printer to go
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
cat /var/log/apctemplists apc temperature every 15 min
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
cf -kto find percentage of disk usage
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
chown ponce apachechange owner to ponce of file [directory] apache
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
df -k /lists used and available space on hard disk
du -aprints number of 512-byte blocks in use by each directory
du -sk apo_backupprints number of kilobytes in apo_backup
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
firefox -P carusto run firefox with carus file
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
lpl myfile.pssends 1 copy of postscript file myfile.ps to defaulf printer (landscape mode) (Visualab implementation)
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
lpqlists print queue
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
mplayer aaa.mpgplays movie aaa.mpg at regular size
mplayer -fs aaa.mpgplays movie aaa.mpg using all screen
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
quota -vshows usage, quota, and limit in user account
rehashrefreshes terminal window to operate newly installed software
rm bde.htmlremoves (deletes) bde.html
rm -r testtestremoves (deletes) directory testtest
rm -rf .mozilla/removes (deletes) cached mozilla directory
scan +outboxdisplays (Mail) outbox file in character cell format
scan +outbox | more displays (Mail) outbox file in character cell format, one page at-a-time
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
scp -r . apu.sdsu.edu:/usr/local/apache/htdocs/poncemakes a secure copy of ponce directory and subdirectories into apu backup folder
show -noshowproc 123displays (Mail) outbox file No. 123
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
strings worddocument.docdisplays to screen content of MS Word document
su - groupmemberswitch (login) to groupmember (requires password)
tail -f /usr/local/apache/logs/ponce.sdsu.edu-error_logdebug files in ponce.sdsu.edu
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
/usr/platform/sun4u/sbin/prtdiag|headlists system config w/memory size
/usr/sbin/poweroffto poweroff server
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
xrefreshrefreshes the x terminal window
!12executes command no. 12 listed by the history command
/usr/platform/sun4u/sbin/prtdiag - vto check platform status
useradd -c 'Firstname Lastname' -s /usr/bin/tcsh -d /export/home/machica -m -g staff machica to create account, then passwd machica type ___ retyp ___



link to link to link to link to
image of

Aerospace | Civil | Electrical | Mechanical | Search | Portal