Linux commands to create and remove a file
touch and cat commands to create the files
kodingwindow@kw:~$ ls a.out KW.class KW.java Desktop Downloads Pictures Templates Weekdays kw.c kw.csv kw.py Documents Music Public Videos kodingwindow@kw:~$ touch Ubuntu.txt Fedora.txt kodingwindow@kw:~$ ls a.out kw.csv Desktop Fedora.txt Public Videos kw.c KW.java Documents Music Templates Weekdays KW.class kw.py Downloads Pictures Ubuntu.txt kodingwindow@kw:~$ cat > KaliLinux ^C kodingwindow@kw:~$ ls a.out kw.csv Desktop Fedora.txt Pictures Ubuntu.txt kw.c KW.java Documents KaliLinux Public Videos KW.class kw.py Downloads Music Templates Weekdays kodingwindow@kw:~$ file Fedora.txt kw.c kw.csv Fedora.txt: empty kw.c: C source, ASCII text kw.csv: CSV text
rm command to remove the file(s)
kodingwindow@kw:~$ rm KaliLinux Weekdays kodingwindow@kw:~$ ls a.out kw.csv Desktop Fedora.txt Public Videos kw.c KW.java Documents Music Templates KW.class kw.py Downloads Pictures Ubuntu.txt
rm command with a regular expression to remove multiple files of the same extension
kodingwindow@kw:~$ rm *.txt kodingwindow@kw:~$ ls -1 a.out kw.c KW.class kw.csv KW.java kw.py Desktop Documents Downloads Music Pictures Public Templates Videos kodingwindow@kw:~$
What Next?
Linux commands to create and remove the directories/sub-directories
Linux commands to copy and move the files
Linux commands for date and time
Advertisement