Useful Linux commands

CommandComment
$ sudo su -Get root privileges and load the root user’s environment.
$ sudo !!Repeat the last command with sudo privileges.
$ printenvPrints all environment variables.
$ ssh-copy-id exampleUse locally available keys to authorize logins on a remote machine.
$ ssh-keygen -R exampleRemove a host entry from the known_hosts file.
$ journalctl -rx -p 4Displays logs in the reverse order with extra information (if available) for priority 4 (warning) or higher.
$ getenforceGet the current mode of SELinux.
$ firewall-cmd --list-allList everything added for or enabled in all policies.
$ firewall-cmd --add-service=example --permanent
$ firewall-cmd reload
Permanently add a service and reload firewall rules so permanent config become new runtime config.
$ grep -rL "example" *Search through all files, including those in subdirectories, and list the ones that do not contain the string "example".
$ git checkout -b example
$ git add .
$ git status
$ git commit
$ git push
$ git checkout main
$ git pull
$ git branch -d example
Create a new branch, add and commit changes, push to a remote repository, switch back to the main branch, pull updates, and delete the example branch.
$ dnf autoremoveRemove unnecessary packages

Posted

in

by

Tags:

Comments

3 responses to “Useful Linux commands”

  1. site Avatar

    Thanks for another informative website. Where else
    may just I get that type of info written in such a perfect way?
    I’ve a mission that I’m just now operating on, and I’ve been at the glance out for such info.

  2. передає Avatar

    Great job making complicated topics feel simple. This platform has become my safety net.

  3. Новини Avatar

    Excellent work on this thoughtful article. The site is remarkably reliable and useful.

Leave a Reply

Your email address will not be published. Required fields are marked *