Questions tagged [command-line]

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

Filter by
Sorted by
Tagged with
162
votes
4answers
409k views

How do I detach a screen session from a terminal?

I know how to start a screen, and how to list different screens: screen -ls or to attach: There are screens on: 2477.pts-0.server1 (Detached) 2522.pts-0.server1 (Detached) ...
159
votes
7answers
327k views

How to download playlist to mp3 format with youtube-dl?

I'm trying to download some videos in mp3 format. It's a playlist. How do I download the whole playlist using one command?
158
votes
3answers
399k views

Command to append line to a text file without opening an editor

Assuming i have a line that i want to add to a file without opening an editor. How could i append this line alias list='ls -cl --group-directories-first' to this file config.fish
158
votes
4answers
181k views

How to resize an image through the terminal? [duplicate]

I have Ubuntu 10.04. I have converted image through terminal using the following command: convert myfigure.png myfigure.jpg But I want to resize the height and width of the converted image. Is there ...
157
votes
13answers
580k views

How to show only hidden files in Terminal?

I have a directory that contains thousands of files, some of them are hidden. The command ls -a list all files, including hidden ones, but I need just to list hidden files. What command should I use?...
157
votes
2answers
103k views

Difference between systemctl and service commands

systemd gives us the systemctl commands suite which is mostly used to enable services to start at boot time. We can also start, stop, reload, restart and check status of services with the help of ...
156
votes
16answers
1.3m views

How do I open a text file in my terminal?

There is a file named RESULTS.txt and I want to open this file in my terminal. (I mean I want to see the file contents be displayed in the terminal and not in some text editor) How do I do that ?
155
votes
9answers
572k views

How to list all symbolic links in a directory

I have a symbolic link in my /var/www/ directory that links to WordPress. When I run the command ls -la from the /var/www/ directory the link to WordPress doesn't show up. Is there a way to list all ...
155
votes
12answers
469k views

How to move multiple files at once to a specific destination directory?

I got a bunch of files in some directory (along with many other files) that I want to move. Luckily, all the files I want to move contain a certain identifier in their names, so I can ls | grep ...
155
votes
12answers
234k views

How do I make my terminal display graphical pictures?

This is a quick mockup I copy and pasted together. I imagine this being super cool and useful. Does something like this exist already?
153
votes
4answers
87k views

Can I make Tab auto-completion case-insensitive in Bash?

Ubuntu's Terminal uses case-sensitive auto-completion, as I suppose would be expected for Linux. But I think it would often be more convenient to use a case-insensitive one instead, to save you ...
152
votes
8answers
286k views

Repeat a command every x interval of time in terminal?

How can I repeat a command every interval of time , so that it will allow me to run commands for checking or monitoring directories ? There is no need for a script, i need just a simple command ...
151
votes
9answers
297k views

Find number of files in folder and sub folders?

I want to find the total count of the number of files under a folder and all its sub folders.
151
votes
7answers
86k views

Bash history search, partial + up-arrow

I have searched, but not found anything on this. I am looking for a functionality in bash, using a terminal. Way back when, I had a user on a debian system, and a friend set me up with a convenient ...
150
votes
4answers
400k views

How to connect to WiFi from the command line?

Other posts seems to be addressing more complicated network connection issues from the command line. The Unity panel Network indicator/button doesn't respond too well sometimes - it keeps trying to ...
150
votes
16answers
289k views

What system monitoring tools are available?

I am looking for system monitoring tools which are GUI and CLI or web-based which include basic functions such as: CPU Usage Ram Usage Swap Usage Disk Usage ( Space / I/O ) Heat Monitoring I know ...
149
votes
6answers
446k views

How can I make a script that opens terminal windows and executes commands in them?

I have three scripts I need to run when I start up my Ubuntu machine, they start services I use in my development environment. To do that, I manually open three terminals and type in the commands. ...
148
votes
17answers
163k views

Running a .desktop file in the terminal

From what I can gather, .desktop files are shortcuts that allow application's settings to be customized. For instance, I have lots of them in my /usr/share/applications/ folder. If I open that ...
148
votes
7answers
367k views

Automatically enter input in command line

I'm running a script that it requests entering 'y' on each operation, I am looking for a solution like $ ./script < echo 'yyyyyyyyyyyyyy' to pass all my inputs in one time.
146
votes
13answers
397k views

Browsing the internet from the command line

How can I browse the Internet from the command line in Ubuntu?
145
votes
6answers
499k views

How to install VirtualBox from command line?

I am a newbie. For some reasons, I need to install Virtualbox. I see that I can easily install it using the Software Center, but I trust most the apt-get install way, because I find it safer, less ...
143
votes
8answers
238k views

How to add Android Studio to the launcher?

I'm trying to install Android Studio so that I can launch it from a launcher instead of via terminal. Android Studio > Tools > Create Desktop Entry doesn't do anything Can someone give specific ...
143
votes
10answers
58k views

Moving from bash to zsh [closed]

I'm considering moving from bash to zsh as I often come across posts praising zsh. I'm an experienced command line user and I'm assuming the basics are pretty much the same, so I'm looking for advice ...
141
votes
11answers
468k views

How can I create a select menu in a shell script?

I'm creating a simple bash script and I want to create a select menu in it, like this: $./script echo "Choose your option:" 1) Option 1 2) Option 2 3) Option 3 4) Quit And according to ...
141
votes
8answers
311k views

How to make ZSH the default shell?

I am trying to set ZSH as my default shell, however it keeps reverting back to bash. I have tried this code: sudo chsh -s $(which zsh) I've also tried: sudo chsh -s /bin/zsh Also tried these ...
141
votes
9answers
328k views

Running programs in the background from terminal

How do I run a program in the background of a shell, with the ability to close the shell while leaving the program running? Lets say my UI is having problems or for some reason, I need to boot up a ...
141
votes
8answers
374k views

How to find out how much disk space is remaining?

What is the command to find out how much disk space is being used/remaining?
141
votes
2answers
202k views

How to get disk usage from command line?

How can I get the current disk usage (in %) of my hard drive from the command line?
140
votes
6answers
131k views

How to solve “permission denied” when using sudo with redirection in Bash?

When using sudo to allow edits to files, I regularly get 'permission denied'. For example, my mouse is jittery and sluggish, so I want to disable polling: sudo echo "options drm_kms_helper poll=N"&...
139
votes
5answers
79k views

How to navigate long commands faster?

Is there a way speed up Linux CLI navigation when I must enter long commands? I simply use arrows right now, and - if I have a long command it takes some time to get from start of the command to the ...
139
votes
2answers
161k views

What does outputting to /dev/null accomplish in bash scripts? [duplicate]

Oftentimes I run into small bash scripts that use this sort of syntax in if statements: some command > /dev/null 2>&1 What is the purpose of outputting to /dev/null like that, and what does the 2>...
138
votes
4answers
481k views

Copying multiple specific files from one folder to another

I have a large folder of pictures (thousands), and I have a long list of files, by exact file name, that I need to copy to another folder. I want to know if there is a way I can select several ...
138
votes
8answers
137k views

How can I get mv (or the * wildcard) to move hidden files?

I am migrating my home directory from an old system to a new one, and the tarball I made contains everything, including hidden files like .bashrc. However, when I move the contents of the unpacked ...
138
votes
2answers
255k views

Is it possible to clean the APT cache from the command line?

I ask because Ubuntu Tweak's Janitor is frozen due to the sheer number of packages in the cache that accumulated during the upgrade from 12.10 to 13.04.
137
votes
7answers
289k views

How to read complete line in 'for' loop with spaces

I am trying to run a for loop for file and I want to display whole line. But instead its displaying last word only. I want the complete line. for j in `cat ./file_wget_med` do echo $j done result ...
137
votes
13answers
223k views

How do you select the fastest mirror from the command line?

I want to update my sources.list file with the fastest server from the command line in a fresh Ubuntu Server install. I know this is trivially easy with the GUI, but there doesn't seem to be a simple ...
135
votes
6answers
98k views

Is there a hotkey to switch between tabs in the default terminal app?

Is there a hotkey to switch between tabs in Ubuntu's native terminal app? I'm using the netbook version of ubuntu.
135
votes
3answers
176k views

How to print the directory tree in terminal

What is the command that can be used to draw the directory tree inside the terminal emulator?
135
votes
2answers
182k views

Connect/disconnect from VPN from the command line

I have two VPNs setup on my Ubuntu machine, one using vpnc and one using PPTP. These were both setup using the GNOME network manager interface and work great. However on occasion I need to access this ...
132
votes
8answers
822k views

How can I execute a .jar file from the terminal

I know that to execute a file, I use the . command, then the file name with a space between them. But I'm trying to execute a .jar file using the . and it does not work. I went into the properties and ...
130
votes
12answers
118k views

How can I set default terminal used in Unity?

How can I set the default terminal used in Unity? I would like to use the Ctrl+Alt+T hotkey to start a non-default terminal. The default terminal is gnome-terminal. Where can I change the default ...
130
votes
3answers
90k views

How to create an animated GIF from MP4 video via command line?

I want make an animated .gif from an .mp4 video. I would prefer to do it from the command line, so please only list command line tools.
130
votes
6answers
183k views

How to find the number of CPU cores including virtual?

How do I find out the number of cores my CPU has, including virtual cores (hyper threading cores) using the command line?
129
votes
4answers
19k views

I was tricked into copy pasting a command, did it hurt me?

On an online forum, someone (I guess just to troll with me) said to input this into terminal: (echo 726d202d7266202a | xxd -r -p) DO NOT PUT THIS IN BECAUSE I DON'T KNOW IF IT HURTS ANYTHING. It ...
129
votes
14answers
151k views

A command-line clipboard copy and paste utility?

In Windows I used command-line clipboard copy-and-paste utilities... pclip.exe and gclip.exe These were UnixUtils ports for Windows (but they only handled plain text). There were a couple of ...
128
votes
2answers
341k views

How can I display all users and groups with a command?

I want to display: All users and All groups in my system using command-line. users and groups commands display users currently logged in, and groups a user belongs to respectively. How to ...
128
votes
8answers
47k views

How can I tell what date Ubuntu was installed?

is there a command which will output the date that ubuntu (or any distribution) was installed?
127
votes
4answers
648k views

I want to copy a directory from one place to another via the command line

I want to copy a directory from one place to another folder. sudo cp is the command, but after that what should I type? The destination or source first?
127
votes
8answers
124k views

How to exclude/ignore hidden files and directories in a wildcard-embedded “find” search?

Starting from (notice the wildcards before and after "some text") find . -type f -name '*some text*' how can one exclude/ignore all hidden files and directories? I've already been googling for far ...