Here’s a table comparing common DOS (Windows Terminal) commands with similar Linux commands:
Function | DOS Command | Linux Command | Description | Example |
---|---|---|---|---|
List directory contents | dir | ls | Displays files and directories in the current directory. | DOS: dir Linux: ls |
Change directory | cd | cd | Changes the current working directory. | DOS: cd foldername Linux: cd foldername |
Create a directory | mkdir | mkdir | Creates a new directory. | DOS: mkdir newdir Linux: mkdir newdir |
Remove a directory | rmdir | rmdir | Deletes an empty directory. | DOS: rmdir olddir Linux: rmdir olddir |
View file contents | type | cat | Displays the contents of a file. | DOS: type file.txt Linux: cat file.txt |
Copy files | copy | cp | Copies files from one location to another. | DOS: copy source.txt dest.txt Linux: cp source.txt dest.txt |
Move/rename files | move | mv | Moves or renames files and directories. | DOS: move file.txt folder/ Linux: mv file.txt folder/ |
Delete a file | del | rm | Deletes a file. | DOS: del file.txt Linux: rm file.txt |
Clear the screen | cls | clear | Clears the terminal screen. | DOS: cls Linux: clear |
View current directory | cd | pwd | Displays the current working directory. | DOS: cd Linux: pwd |
Search for files | dir /s | find / find . | Searches for files in the current and subdirectories. | DOS: dir /s *.txt Linux: find . -name "*.txt" |
Check disk usage | dir | du / df | Shows disk usage of directories or free space on disks. | DOS: dir Linux: du -sh folder or df -h |
Rename a file | ren | mv | Renames a file. | DOS: ren oldname.txt newname.txt Linux: mv oldname.txt newname.txt |
Edit files | edit | nano / vim | Opens a text editor to modify files. | DOS: edit file.txt Linux: nano file.txt or vim file.txt |
Network diagnostics | ping | ping | Sends packets to test network connectivity. | DOS: ping google.com Linux: ping google.com |
Process management | tasklist | ps / top | Lists running processes. | DOS: tasklist Linux: ps aux or top |
Kill processes | taskkill | kill / killall | Terminates processes. | DOS: taskkill /IM app.exe Linux: kill PID or killall app |
Change file attributes | attrib | chmod / chown | Modifies file attributes or permissions. | DOS: attrib +r file.txt Linux: chmod 755 file.txt |
Compress files | compact | tar / gzip | Compresses files or directories. | DOS: compact file.txt Linux: gzip file.txt or tar -czf archive.tar.gz folder |
Uncompress files | expand | tar / gunzip | Decompresses files. | DOS: expand file.cmp Linux: gunzip file.gz or tar -xzf archive.tar.gz |
Shutdown system | shutdown | shutdown | Powers off the system after a delay or immediately. | DOS: shutdown /s /t 0 Linux: shutdown now |
This table provides a concise comparison to help navigate between DOS and Linux terminal commands! Let me know if you’d like examples elaborated.