Linux commands: Difference between revisions

Jump to navigation Jump to search
9 bytes added ,  6 September 2016
m
Line 120: Line 120:
* List all files and directories including hidden ones in the current directory. On {{Win}} is {{kbd | key=<nowiki>dir /a</nowiki>}}, and on {{Mac}} or {{Linux}} is {{kbd | key=<nowiki>ls -a</nowiki>}}<ref>[http://www.computerhope.com/issues/ch001039.htm How to see hidden files in MS-DOS and the Command Prompt]</ref><ref>[http://www.cyberciti.biz/faq/bash-shell-display-only-hidden-dot-files/ Bash Shell: Display All Hidden Dot Files In a Directory]</ref>.
* List all files and directories including hidden ones in the current directory. On {{Win}} is {{kbd | key=<nowiki>dir /a</nowiki>}}, and on {{Mac}} or {{Linux}} is {{kbd | key=<nowiki>ls -a</nowiki>}}<ref>[http://www.computerhope.com/issues/ch001039.htm How to see hidden files in MS-DOS and the Command Prompt]</ref><ref>[http://www.cyberciti.biz/faq/bash-shell-display-only-hidden-dot-files/ Bash Shell: Display All Hidden Dot Files In a Directory]</ref>.


Verify if a file or a folder exists
Verify if a file or a directory exists
* On {{Linux}}: {{kbd | key= ls /path/to/file}} or {{kbd | key= ls -d /path/to/folder/}} e.g. {{kbd | key= ls -d ~/}} to list your home directory<ref>[https://linuxconfig.org/single-linux-command-to-return-to-home-directory Single linux command to return to home directory]</ref>.
* On {{Linux}}: {{kbd | key= ls /path/to/file}} or {{kbd | key= ls -d /path/to/directory/}} e.g. {{kbd | key= ls -d ~/}} to list your home directory<ref>[https://linuxconfig.org/single-linux-command-to-return-to-home-directory Single linux command to return to home directory]</ref>.
* On {{Win}}:  
* On {{Win}}:  
** {{kbd | key= dir C:\path\to\file}} or {{kbd | key= dir C:\path\to\folder\}}
** {{kbd | key= dir C:\path\to\file}} or {{kbd | key= dir C:\path\to\directory\}}
** {{kbd | key= IF EXIST}} e.g. [http://stackoverflow.com/questions/3022176/how-to-verify-if-a-file-exists-in-a-windows-bat-file How to verify if a file exists in a Windows .BAT file? - Stack Overflow]
** {{kbd | key= IF EXIST}} e.g. [http://stackoverflow.com/questions/3022176/how-to-verify-if-a-file-exists-in-a-windows-bat-file How to verify if a file exists in a Windows .BAT file? - Stack Overflow]


Navigation menu