Junior
What administrative commands do you know in Linux?
sobes.tech AI
Answer from AI
ls- view directory contentscd- change current directorypwd- display full path to current directorymkdir- create a new directoryrmdir- delete an empty directoryrm- delete files and directories (with options)cp- copy files and directoriesmv- move/rename files and directoriescat- display contents of text filesless/more- paginated view of file contentshead- display the beginning of a filetail- display the end of a filegrep- search for lines matching a patternfind- search for files based on various criteriaecho- output a string to standard outputman- display help information about a commandsudo- execute a command with superuser privilegeschown- change file/directory ownerchgrp- change group owner of a file/directorychmod- change access permissions of a file/directoryps- view list of running processestop- interactive system process monitorkill- terminate a process by PIDdf- display free disk space informationdu- estimate disk space used by files/directoriesfree- information on RAM usageping- check network connectionssh- remote connection to a serverscp- copy files between servers over SSHwget/curl- download files from the internettar- work with archives (create, extract)gzip/bzip2- compress/extract filessystemctl- manage services (systemd)journalctl- view system logs (systemd)
Examples of using some commands:
# List files in the current directory with detailed info
ls -l
# Create a directory named 'my_project'
mkdir my_project
# Copy 'config.ini' to the 'backup' directory
cp config.ini backup/
# Move 'script.py' to the 'bin' directory and rename it to 'run_script'
mv script.py bin/run_script
# Find all '.log' files in the current directory and subdirectories
find . -name "*.log"
# Change owner of 'data.txt' to user 'admin'
sudo chown admin data.txt
# Check the status of the apache2 service
systemctl status apache2