Sobes.tech
Senior

What Linux commands do you know? Share a case of working with the console.

sobes.tech AI

Answer from AI

In Linux, there are many useful commands for working with the console. Here are some basics:

  • ls — displays a list of files and folders in a directory.
  • cd — changes the current directory.
  • pwd — shows the current path.
  • cat — outputs the contents of a file.
  • grep — searches through text.
  • ps — displays running processes.
  • kill — terminates a process.
  • chmod — changes file permissions.
  • tar, zip — archiving.
  • ssh — connecting to remote servers.

Example case:

Suppose you need to find all error lines in logs, compress them, and send to a remote server.

cd /var/log/myapp
grep "ERROR" *.log > errors.log
zip errors.zip errors.log
scp errors.zip user@remote-server:/home/user/

Here, we navigate to the log folder, find all errors, save them to a file, archive, and copy to a remote server via SSH.

This set of commands allows efficient work with files, processes, and remote systems directly from the console.

What Linux commands do you know? Share a case of… - sobes.tech