Why Do Command Lines Still Exist ?

ยท 464 words ยท 3 minute read

GUI (graphical user interface) is easy to use and goodlooking. But CLI (command line interface) is faster and easier to automate.

Advantages of Command Line over Graphics ๐Ÿ”—

Graphics are fancy but lack clarity and prone to errors and crashes and uses alot of resources (RAM, CPU and GPU). Here are some advantages.

Lightweight Text Interface ๐Ÿ”—

If you accomplish a task like converting mp4 to mp3 on command line using ffmpeg , it will be faster than using any other GUI program such as Format Factory (for Windows OS).

If you are trying to connect to a server (or another computer) to controll it, it’s easer to use SSH as it is a CLI app. But if you use VNC or any other graphical programs, you’ll face errors and high usage of internet bandwidth and some glitches.

CLI is faster than GUI because CLI is text based. And text is lighter than Graphics ofcourse.

Repetitive Tasks ๐Ÿ”—

If you want to rename too many files, it is frustrating to do it in GUI. Select a file, right click, choose rename, and write a new name, select the second file, right click, choose rename, .. it is so bad.

But in CLI, you can write a Bash script to automate the file renaming, then run the script on those files. That’s it. Just a Bash script to automate the task of renaming files.

If you do a repetitive task, CLI is better than GUI.

Consistency Across-platforms ๐Ÿ”—

If you use Mac OS, Ubuntu and Pop! OS, you can run Bash scripts on all those platforms to detect and fix some error or accomplish a text. But it is harder to give graphical steps to fix something on all those three operating systems.

CLI makes usage of Linux distribution easier because of POSIX compliant Bash shell on all of them. That’s great consistency.

Tricks & Advanced ๐Ÿ”—

GUI has the functions and buttons which developers want to add. But the tricks and advanced workarounds are still in CLI.

Many advanced third-party tools and programs use a sophisticated functionality that is in your operating system but need to do it in command line, so those developers wrap those sophisticated commands in the GUI of their program.

Software developers use CLI more than GUI because they value working stuff than fancy ones.

Examples of CLI usage ๐Ÿ”—

  • SSH to other computers and servers.
  • bulk rename too many files. Batch rename files in Windows powershell : ls | Rename-Item -NewName {$_.name -replace "beach--", "hiking_trip_"}.
  • monitoring files for changes (for example, tail -f access.log).
  • copying too many files from three folders to one other folder.
  • show WIFI passwords in Windows : netsh wlan show profile name=Username key=clear.
  • set a timer to shutdown your PC : shutdown -s -t 1200.
Share:
waffarx cash back