JCAC Mod 5 Advanced UNIX Commands
This flashcard set explains the touch command in UNIX, used to create empty files or update file timestamps. The touch -t option specifically allows manual modification of a file’s access and modification date/time.
FILE AND DIRECTORY COMMAND
touch
touch -t
touch: Creates an empty file and is also used to modify a files timestamp
touch -t: Manipulates the file’s access date/time stamp
Key Terms
FILE AND DIRECTORY COMMAND
touch
touch -t
touch: Creates an empty file and is also used to modify a files timestamp
touch -t: Manipulates the file’s access date/time stamp
FILE AND DIRECTORY COMMAND
mkdir
mkdir -p
Creates one or more directories
Creates a directory where no parent exists (nested)
FILE AND DIRECTORY COMMAND
cp
cp -r
Copies files and directories
Recursively copy directories.
FILE AND DIRECTORY COMMAND
mv
Moves or renames files and directories
FILE AND DIRECTORY COMMAND
ln
ln -s
Creates a link between files or directories
Creates a symbolic link to another file.
FILE AND DIRECTORY COMMAND
rm
rm -r
rm -f
Removes a file or a directory with contents if using the -r option
rm -f : Ignore nonexistent files, never prompt (fo...
Related Flashcard Decks
Study Tips
- Press F to enter focus mode for distraction-free studying
- Review cards regularly to improve retention
- Try to recall the answer before flipping the card
- Share this deck with friends to study together
| Term | Definition |
|---|---|
FILE AND DIRECTORY COMMAND | touch: Creates an empty file and is also used to modify a files timestamp |
FILE AND DIRECTORY COMMAND | Creates one or more directories |
FILE AND DIRECTORY COMMAND | Copies files and directories |
FILE AND DIRECTORY COMMAND mv | Moves or renames files and directories |
FILE AND DIRECTORY COMMAND | Creates a link between files or directories |
FILE AND DIRECTORY COMMAND | Removes a file or a directory with contents if using the -r option |
FILE AND DIRECTORY COMMAND grep | Searches a file or files for lines that contain strings of a certain pattern. |
FILE AND DIRECTORY COMMAND find | Locates files having certain specified characteristics |
FILE AND DIRECTORY COMMAND which | Displays full path (location) of most (shell) commands |
FILE AND DIRECTORY COMMAND file | Determines file type. |
FILE AND DIRECTORY COMMAND ps -e | Displays a snapshot status of active processes. (A process running in the background is called a daemon ) |
FILE AND DIRECTORY COMMAND | Stops a process from running using its PID |
FILE AND DIRECTORY COMMAND | Stops a process from running using its process name |
FORENSICS COMMANDS history | Maintains a history file of all commands run by a particular user in that shell. |
FORENSICS COMMANDS strings | Prints the strings of printable characters in a file (not ASCII characters). Useful in determining content of non-text files (executables) |
FORENSICS COMMANDS script | Creates a typescript of the terminal session (everything printed on the terminal). CTRL+d ends the script session. View results using less. |
FORENSICS COMMANDS su | Used to switch from the current user account to another. It is often used to switch to root user to perform tasks requiring elevated privileges. |
FORENSICS COMMANDS whoami | Displays who the user is logged in as at this moment (after switching user). |
FORENSICS COMMANDS who | Displays user login information including login name, time, terminal, and more |
FORENSICS COMMANDS w | Displays information about the user(s) logged in and what they are doing. |
FILE COMPRESSION COMMANDS (only 2) gzip | Compresses a files and appends a .gz file extension. The original file is replaced |
FILE COMPRESSION COMMANDS (only 2) gunzip | Decompresses a file that was compressed with gzip |
ARCHIVING COMMANDS (1 command, 7 options) tar | Tape archive utility used to archive files to tape or disk |
ARCHIVING COMMANDS (1 command, 7 options) tar -c (lowercase c) | Create an archive |
ARCHIVING COMMANDS (1 command, 7 options) tar -t | List table of contents of tar file |
ARCHIVING COMMANDS (1 command, 7 options) tar -x | Extract, must be in target directory to extract |
ARCHIVING COMMANDS (1 command, 7 options) tar -z | Compress the archived file using gzip (tarball) |
ARCHIVING COMMANDS (1 command, 7 options) tar -v | Verbose, list each file as tar reads/writes |
ARCHIVING COMMANDS (1 command, 7 options) tar -f | Read/write to or from a file |
ARCHIVING COMMANDS (1 command, 7 options) tar -C (capital c) | Change to directory |
SCHEDULING JOBS COMMANDS | at | Schedules a job/process for a one-time execution |
SCHEDULING JOBS COMMANDS | atq | Lists user’s pending jobs. |
SCHEDULING JOBS COMMANDS | atrm | Deletes user’s jobs identified by job number |
SCHEDULING JOBS COMMANDS | crontab | Schedules periodic jobs. The cron daemon (crond) checks the /etc/crontab every minute for any jobs that need to run. To create a cron job, the cron table (crontab) is created or modified. |
SCHEDULING JOBS COMMANDS (crontab option) | crontab -e | Edit the crontab |
SCHEDULING JOBS COMMANDS (crontab option) | crontab -l | List crontab entries |
USER ACCOUNT RELATED COMMANDS | useradd | Creates a new user or updates default new user information |
USER ACCOUNT RELATED COMMANDS (useradd opt) | useradd -d | Specifies the path of the user’s home directory; |
USER ACCOUNT RELATED COMMANDS (userad opt) | useradd -m | Makes a home directory if it doesn’t already exist |
Makes a home directory if it doesn’t already exist | Assigns whatever group is in default |
USER ACCOUNT RELATED COMMANDS | Deletes a user account |
USER ACCOUNT RELATED COMMANDS | passwd | Enables a user to change their password (no user name) or for root to set and modify password settings. |