Cornell High Energy Synchrotron Source

Doc#: REF-COMP-002 Reference: CHESS Basic Linux Guide Prepared by:ZB
Rev.: 1 Revision Date: 11/02/12 Date Effective: Date Expires: Approved by:

Basic Navigation and Controls


Command

Opt

Description

Example

Tab key

Autocomplete file or path name.

[↑] Arrow

Recall previous commands.

[Ctrl] + C

Kill current command.

pwd

Print working directory.

pwd

cd path

Change directory to path. cd .. moves up one directory level. cd alone will go to home directory.

cd /home/specuser/Macros
cd ..
cd

ls

-l

Lists contents of current directory.
-l displays file details

ls

halt

Shut down computer.

halt

reboot

Reboots computer.

reboot

su username

Switch user. No username will attempt login as root.

su specadm

sudo username

Allows username to perform an action as root if privileges are set.

sudo specadm rm file

exit

Log out and return to previous user.

exit

File Structure


Command

Opt

Description

Example*
*/path/file Run executable file. /home/test/start.cmd
./file Run executable file in current directory. ./start.cmd
mkdir/path/new_folder/ Make a new directory new_folder, in location /path/ mkdir /home/test/dir/
rmdir/path/folder_name/ -r Remove directory folder_name, in location path. rmdir /home/test/dir/
cp /path/file /path2/copied_file Copy file in directory /path/ to /path2/ as new file file2 cp /test/file1 /test/file2
mv/path/file /path2/file Move file in directory /path/ to directory /path2/. (like Cut & Paste) mv /test/file /test2/file
rm/path/file -r Remove file (delete). rm /test/file
chmod /path/file -R Change file/folder read/write permissions. Example gives full permissions within /test/ to all users chmod –R 777 /home/specuser/test/

Information


Command

Opt

Description

Example*
*ps -ax List all processes ps –ax
killall process_name -9 Kill process_name. -9 extra-kills process. killall st.cmd
man command_name Displays manual for command. “q” to quit. man spec
help command_name Displays help file for command. help ifconfig
less file View file content. “q” quits. less st.cmd
ifconfig Display Network Configuration. ifconfig
gedit file Opens file in Gedit text editor. NOTE: Not always available gedit st.cmd
vi file Opens file in vi, an in-terminal text editor. NOTE: Appendix for details on vi commands and usage. vi st.cmd

Remote Services


Command

Opt

Description

Example*
*sshusername@hostname Open a remote connection to hostname ssh specuser@ops1
sftp username@hostname Open secure file transfer connection to hostname sftp specuser@ops1
put /path/file /remotepath/remotefile sftp command - transfers file from local computer to remote in /path/ put /home/specuser/file /home/opsuser/file
get /remotepath/remotefile/ /localpath/localfile sftp command - to transfer file from remote computer to local in /path/ get /home/opsuser/file /home/specuser/file
telnet ip_address port Open serial connection to IP and port. telnet 192.168.182.93 4001
[Ctrl] + ] Close telnet connection
exit Close ssh, sftp, telnet exit

Printer Commands


Command

Opt

Description

Example*
lpr /path/file Print file. lpr /home/test/st.cmd
*lpq Display print queue. lpq
lprm job_number Removes job_number from print queue. No job number removes current job. lprm 99
/sbin/service cups restart Stops/restarts printing service. NOTE: requires root access. /sbin/service cups restart

Appendix I – vi Commands


Command

Opt

Description

Example*
*vi/path/file Open file in vi. vi /Macros/userlist.mac
Arrow Keys Move cursor.
i Insert text before cursor.
a Append text after cursor.
[ESC] Key Exit “Edit” mode.
u Undo/redo last command (not in Edit mode).
:w Write out changes (save).
:q Quit vi.
:wq Save and quit vi.
:q! Quit without saving.
Revision History
Rev. 1 – Initial document (11/02/12 - ZB)

-- LeeShelp - 24 Apr 2017

This topic: CHESS > Ref-comp-002
Topic revision: 24 Apr 2017, ljs30
This site is powered by FoswikiCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding CLASSE Wiki? Send feedback