Fichas
Linux Commands
Fichas del conjunto (19)
- 1pwdPrint Working Directory
$ pwd
/Users/sonny/Downloads - 2mkdirMake Directory
$ mkdir new-directory
$ ls
old-directory new-directory - 3lsList
$ ls Desktop
resume.pdf
photo.png - 4cdChange Directory
$ cd some-directory
$ cd .. - 5touchCreate New File
- 6cpCopy
$ cp file1 file1_copy
$ cp file1 file2 destination_folder - 7mvMove
$ mv index.html website/ - 8rmRemove
$ rm -r bad_selfies
The shell command rm is used to delete files and directories. The -r flag deletes a directory and all of its files and directories (rm -r). - 9ls List Command Options-a: lists all contents, including hidden files and directories.
-l: lists all contents, in long format.
-t: lists all contents, by the time they were last modified. - 10catDisplay
The shell command cat displays the contents of one or more files to the terminal.
$ cat poem.txt
$ cat poem.txt kitties.txt - 11grepSearch
The shell command grep is used to search files for lines that match a pattern and returns the results.
grep 'sonny' names.txt - 12Command Line RedirectionRedirection can be done by using the operators > and >>
ls > directories_list.txt
ls >> directories_list.txt - 13AliasThe shell command alias is used to assign commonly used commands to shortcuts (or aliases).
# The following command creates an alias `pd` for the command `pwd`
alias pd="pwd" - 14HOME Environment Variable in Unix SystemsHOME is an environment variable present in command line environments. It is used to get the path to the current user’s home directory.
# To show the path of the home directory use the following command:
echo $HOME - 15Export commandThe export command makes a given variable available to all child sessions initiated from the current session.
This command will make the environment variable USER available
to all child sessions with the value "Jane Doe".
export USER="Jane Doe" - 16Source Bash ProfileAll the commands in ~/.bash_profile are executed with the shell command source ~/.bash_profile. So when changes are made to ~/.bash_profile, run this command to activate the changes in the current session.
- 17Environment VariablesVariables that can be used across terminal commands are called environment variables. They also hold information about the shell’s environment.
- 18Shell Command envFor Unix-based systems like Mac OS and Linux (not Windows), the shell command env returns a list of environment variables for the current user.
- 19Command line environmentThe environment of the command line refers to the settings and preferences of the current user. It enables users to set greetings, alias commands, variables, and much more.
Información
- Descripción
- Example command line flashcards to learn easily. https://www.codecademy.com/learn/learn-the-command-line/modules/learn-the-command-line-environment/cheatsheet
- Creado por
- Thomas Lynass · abr 2021
- Actualizado
- 16 abr 2021
- Visitas
- 6
- Etiquetas
- Valoración