|
- What are the differences between su, sudo -s, sudo -i, sudo su?
81 sudo lets you run commands in your own user account with root privileges su lets you switch user so that you're actually logged in as root sudo -s runs a shell with root privileges sudo -i also acquires the root user's environment To see the difference between su and sudo -s, do cd ~ and then pwd after each of them
- sudo - How do I login as root? - Ask Ubuntu
In that case, use: sudo su - to execute a login shell as root after auhenticating sudo, and that shell will not need sudo to run admin commands To return to the normal user shell, insert the command exit
- How to unzip a zip file from the Terminal? - Ask Ubuntu
sudo unzip path filename zip -d another_path_or_same_path if we does not use option -d the file will be extracted to present working directory And if the zip file is password protected we can also use -P use tar Command in Linux Unix tar is an acronym for Tape Archive tar command is used to Manipulates archives in Linux Unix
- How do I reset a lost administrative password? - Ask Ubuntu
$ sudo -i [sudo] password for myuseraccount: # here you type the user's password # A lot of people that have Unix background or experience with other distributions stumble on this issue quite often The command su will always fail because the root account is locked; it cannot be accessed directly or you cannot login directly to root
- apt - How to list all installed packages - Ask Ubuntu
sudo dpkg --set-selections < user-installed list sudo apt-get dselect-upgrade Before starting this task, I recommend reading and understanding all parts of the post mentioned in the beginning, and then consult the aptitude reference guide for details on search patterns and the Customizing how packages are displayed to use the -F option as you like
- How to remove all files from a directory? - Ask Ubuntu
To remove a folder with all its contents (including all interior folders): rm -rf path to directory To remove all the contents of the folder (including all interior folders) but not the folder itself: rm -rf path to directory * or, if you want to make sure that hidden files directories are also removed: rm -rf path to directory {*, *} To remove all the "files" from inside a folder (not
- How do I rename a directory via the command line? - Ask Ubuntu
I have got the directory home user oldname and I want to rename it to home user newname How can I do this in a terminal?
- Change folder permissions and ownership - Ask Ubuntu
Use chown to change ownership and chmod to change rights As Paweł Karpiński said, use the -R option to apply the rights for all files inside of a directory too Note that both these commands just work for directories too The -R option makes them also change the permissions for all files and directories inside of the directory For example sudo chown -R username:group directory will change
|
|
|