1.4 KiB
1.4 KiB
Unix Commands
Navigation
pwdPrint Working Directory-
lsList Segments: list files-aAll - show hidden files-lLong-tTime - in order of modification time
cdChange DirectorymkdirMake Directory
Manipulation
cp: copies filesmv: moves and rename filesrm: remove filesrm -r: remove directories (-r : Recursive)
Redirection
>: redirects output of a command to a file, overwriting previous content>>: redirects output of a command to a file, appending new content to previous content<: redirects standard input to a command|: redirects standard output of a command to another commandsort: sort lines of text alphabeticallyuniq: filters duplicate, adjacent lines of textgrep: searches for a text pattern and outputs itsed: searches for a text pattern, modifies it, and outputs it
Environnement
~(alt+n) : user’s home directorynano: line text editor-
\.bash_profile: is where environment settings are storedexport VARIABLE='Value'USER: the name of the current userHOME: home directory (not to customize)env: return a list of environment variables
Grep
grep texte nomfichier
-i: ne pas tenir compte de la casse (majuscules / minuscules)-n: connaître les numéros des lignes-v: inverser la recherche : ignorer un mot-r: rechercher dans tous les fichiers et sous-dossiers