“ls” and “touch” commands in Terminal

TS
Sep 28, 2021

--

“ls” is a command that shows a list of all files and directories in a current directory.

“ls *.txt” shows all files name that matches the string before .txt;

“ls -l” is a command that shows the long form of a list with a date and time indicator of file modification, the size of the file, etc;

“ls -rtl” (list by reversed time of modifications)

“touch” is a command to create an empty file with a name.
If you want to create a file, and you don’t care about a name, the name is usually “foo,” then “bar,” “baz,” “qux,” “quux,” etc.

--

--

No responses yet