This document provides commands for working with directories, files, printing, finding and organizing files, security operations, system operations, and process operations in a UNIX-like system. Some key commands are pwd to show the current working directory, cd to change directories, ls to list files and directories, cp to copy files, rm to remove files, and ps to list running processes. Pipes and input/output redirection are also covered.
Download as DOC, PDF, TXT or read online on Scribd
0 ratings0% found this document useful (0 votes)
994 views
Hpux Commands
This document provides commands for working with directories, files, printing, finding and organizing files, security operations, system operations, and process operations in a UNIX-like system. Some key commands are pwd to show the current working directory, cd to change directories, ls to list files and directories, cp to copy files, rm to remove files, and ps to list running processes. Pipes and input/output redirection are also covered.
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 2
Working with Directories
Show current working directory pwd
Change directory cd directory_path Change to home directory cd Create a directory mkdir directory_name Remove an (empty) directory rmdir directory_name Working with Files Read mail elm List files and directories in current directory ls List all files or directories, including invisible ("dot") files ls -a List files, and mark directory names with "/" lsf Compress a file compressfilename Uncompress a file uncompressfilename Create or edit a file vi file_name Display file contents morefile_name (q to quit) Display the first 10 lines of a file head file_name Display the last 10 lines of a file tail file_name Copy a file cp file_name file_copy Move a file to a new file name mv old_file new_file Append file1 onto the end of file2 cat file1 >> file2 Remove file rmfile Remove a directory dir_name and all its files rm -rf dir_name Check the spelling in a file spell file_name Printing Print a file lp file_name Determine printer status lpstat -t Cancel a print request cancelrequest_id Finding and Organizing Find file(s) beginning with x in current and subdirectories find . -name 'x*' Find all occurrences of word in all files in current directory grep word * Sort listfile alphabetically sort listfile Display date and time date List all command aliases alias Find HP-UX command information man command_name Determine PATH setting echo $PATH Determine what shell you're in echo $SHELL Security Operations Create or change password passwd Display permissions for a file ll file_name Display permissions for a directory ll -d directory_name Change file or directory permissions chmod class=permissions name Change file or directory ownership chownusername To Do This ... Type This ... System Operations Clear screen clear Set command-line editor set -o editor_name Edit your command line (in Korn/Key/Posix Shell set for vi) ESC (use vi commands) Recall previous command line (with vi editor) ESCk (back) or j (forward) Execute previous command line Enter (when line is displayed) Set terminal type (select term_type from /usr/lib/terminfo) TERM=term_type List current process status and PIDs|ps -ef Kill (terminate) a process kill PID Create or change a password passwd Redirect input from a file to a command command < infile Connect two processes with a "pipe" command1 | command2