Questions tagged [command-line]

Questions about using the command-line interface (CLI).

What Questions Should Have This Tag?

  • How do I do this via command line?
  • Basic Command Line commands
  • Shell Specific commands

Basic Definitions:

Command Line Interface is a way of interacting with the system and software by typing text commands into a terminal (or terminal emulator).


The command-line is also known as

  • Console
  • Shell
  • Terminal
  • Command prompt

Brief Introduction to the Subject:

"Under Linux there are GUIs (graphical user interfaces), where you can point and click and drag, and hopefully get work done without first reading lots of documentation. The traditional Unix environment is a CLI (command line interface), where you type commands to tell the computer what to do. That is faster and more powerful, but requires finding out what the commands are."

from man intro(1)

Some users prefer using the command line for some tasks because it saves them time and effort. They also benefit from being able to create scripts to automate common tasks, and they can use the command line to configure their operating system on a very low level to exactly fit their needs.


Important Links for Learning More:

Questions using this tag might be related to Bash - the default command line shell in Ubuntu, Shell-Scripting and Programming.

21466 questions
2001
votes
9 answers

How to unzip a zip file from the Terminal?

Just downloaded a .zip file from the internet. I want to use the terminal to unzip the file. What is the correct way to do this?
ubuntu-nerd
  • 20,269
  • 4
  • 15
  • 9
1324
votes
11 answers

How do I install a .deb file via the command line?

How do I install a .deb file via the command line?
TheXed
  • 25,066
  • 13
  • 58
  • 89
1267
votes
10 answers

How do I save terminal output to a file?

How do I save the output of a command to a file? Is there a way without using any software? I would like to know how.
led-Zepp
  • 12,945
  • 5
  • 14
  • 12
1196
votes
8 answers

How can I copy the contents of a folder to another folder in a different directory using terminal?

I am trying to copy the contents of a folder to another folder in a different directory using terminal. Would somebody be able to provide me an example of the command line syntax required to achieve this?
pandisvezia
  • 12,181
  • 3
  • 14
  • 7
1076
votes
13 answers

How do I determine the total size of a directory (folder) from the command line?

Is there a simple command to display the total aggregate size (disk usage) of all files in a directory (folder)? I have tried these, and they don't do what I want: ls -l, which only displays the size of the individual files in a directory, nor df…
David Barry
  • 10,863
  • 3
  • 15
  • 8
1029
votes
9 answers

Is there a command to list all users? Also to add, delete, modify users, in the terminal?

I need a command to list all users as well as commands to add, delete and modify users from terminal - any commands that could help in administrating user accounts easily by terminal.
nux
  • 36,031
  • 33
  • 115
  • 130
931
votes
5 answers

How do I shut down or reboot from a terminal?

How can I shut down or reboot Ubuntu using terminal commands?
rɑːdʒɑ
  • 97,211
  • 101
  • 250
  • 322
928
votes
7 answers

How can I add a user as a new sudoer using the command line?

After I add a user using adduser, I can't see it via System > Administration > Users and Groups unless I log out and then log in again. Is that normal? Also, can I set a newly added user as a sudoer or do I have to change that only after adding it?…
David B
  • 10,612
  • 6
  • 24
  • 18
874
votes
8 answers

Find and replace text within a file using commands

How can I find and replace specific words in a text file using command line?
Jon Doe
  • 10,667
  • 6
  • 21
  • 12
848
votes
9 answers

How to install updates via command line?

When I log into my web server via SSH I see the information: 88 packages can be updated. 80 updates are security updates I tried apt-get update then apt-get upgrade but each time I log in I still see the message about updates. How do I install…
Marlin
  • 8,634
  • 3
  • 13
  • 5
820
votes
8 answers

How can I recursively delete all files of a specific extension in the current directory?

How do I safely delete all files with a specific extension (e.g. .bak) from current directory and all subfolders using one command-line? Simply, I'm afraid to use rm since I used it wrong once and now I need advice.
user216038
  • 8,203
  • 3
  • 11
  • 4
815
votes
9 answers

How do I search for available packages from the command-line?

I have successfully installed some packages using the command line 'sudo apt-get install packagename' when I have known in advance that those packages are available. But how can I search for or get a list of what is available in the repositories?
Mark Thomas
  • 8,255
  • 3
  • 14
  • 9
767
votes
4 answers

How to delete a non-empty directory in Terminal?

How do I delete the following directory? I typed: rmdir lampp This error comes up: rmdir: failed to remove `lampp': Directory not empty Is there a command to delete all the files in the directory and delete the directory folder?
naveen
  • 7,897
  • 4
  • 13
  • 14
744
votes
7 answers

How do I rename a directory via the command line?

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?
N.N.
  • 17,339
  • 18
  • 55
  • 92
717
votes
9 answers

Change folder permissions and ownership

I would like the user to have full rights on this folder (as well as all sub-directories and files in it): ~/.blabla currently owned by root. I have found numerous posts (in this forum and elsewhere) on how to do this for files but I can't find a…
user2413
  • 13,027
  • 15
  • 53
  • 84
1
2 3
99 100