The command-line is the interactive interface to your shell.

learn more… | top users | synonyms (1)

4
votes
4answers
465 views

Run the same command multiple times in background

How is it possible to run multiple commands and background them using bash? For example: $ for i in {1..10}; do wait file$i &; done where wait is a custom binary. Right now I get an error: ...
7
votes
1answer
3k views

List of modified files of the past 24 hours

Is there a reliable way to have a system that mails me the list of files that were modified in the past 24 hours inside a set of directories? (like /home/*/public_html/* and /home/*/*domains/*)
0
votes
1answer
1k views

How to boot GUI on a fedora 21 server through the command line

I am trying to install a GUI onto my fedora21 virtual machine. The only problem is due to the nature of work i am doing it needs to be done through the command line( i am using a program called ...
54
votes
13answers
130k views

What is the fastest way to view images from the terminal?

The terminal is very fast and convenient way to quickly access directories and files (faster than find and click on the directory). One thing that it cannot show in text-mode is "pictures". What ...
56
votes
9answers
145k views

How to overwrite target files with mv?

I have a ton of files and dirs in a subdirectory I want to move to the parent directory. There are already some files and dirs in the target directory which need to be overwritten. Files that are only ...
0
votes
3answers
785 views

How to stop Rainlendar from hiding on the Linux Mint desktop?

Rainlendar is a great tool to keep events and tasks on the desktop (I did not find a better solution yet). The problem is that the application completely hides if you press: The "Show Desktop" ...
0
votes
0answers
77 views

Running a batch script remotely using rdesktop

I have a setup that implies calling rdesktop on a remote machine which is accessed through ssh: user@192.168.1.110:~$ ssh user@192.168.1.120 -X and then running rdesktop as: user@192.168.1.120:~$ ...
1
vote
0answers
22 views

Splitting correctly avi file

I'm trying to split an avi file as follows. avconv -i file.avi -vcodec copy -acodec copy -ss 0 -t 10 out.avi and this works (It creates a chunk with first 10 seconds of the video). The problem is ...
66
votes
11answers
80k views

How do I convert an epoch timestamp to a human readable format on the cli?

How do I convert an epoch timestamp to a human readable format on the cli? I think there's a way to do it with date but the syntax eludes me (other ways welcome).
1
vote
0answers
41 views

How do I go about downloading 100,000 torrents?

I want to download a large number of torrents on Ubuntu, while keeping a positive ratio on the torrent tracker. Since various torrent clients won't support that many active torrents (from what I ...
-1
votes
3answers
50 views

How to swap two words with sed and with multiple delimiters?

Just letters are accepted in words, any other characters are delimiters. I want to exchange the first word with the third word. sed -E 's/([A-Za-z]+) [^A-Za-z] ([A-Za-z]+) [^A-Za-z] ([A-Za-z]+)/\3 \2 ...
2
votes
2answers
72 views

“ls” command stuck trying to list a stale mount point. How do you kill/stop it?

When working with remote filesystems such as sshfs or smbfs, it is command that they become stale due to network problems. To check if the mount is stale or not, I usually use the command ls to see if ...
3
votes
4answers
55 views

Search within a search

I've gotten used to using grep for my command line searches and wanted to know how to successfully do a search using the result of another search. Here's my attempt, where I am looking for 'tool' ...
-1
votes
3answers
29 views

Write in a part of a document the current time? [closed]

How can you write the current time from terminal in a document? In a specific place of the document, I mean.
1
vote
3answers
104 views

Why 'cat' can't read content of pdf files?

When tried the command cat < 1.pdf it printed a very large output, which was totally incomprehensible to me. The content of 1.pdf was abc. The output was like this: ...
1
vote
2answers
28 views

Wait for program in a clean way (e.g. in a different terminal window)

If you want to execute one command and then another one after the first one finish, you can execute command1 & which prints the PID of the process executing command1. You can then think of ...
20
votes
12answers
21k views

How can I “cat” a file and remove commented lines?

I'd like to know if there is a way that I could cat file like php.ini and remove all lines starting with ; For example, if the file contained this: ; - Show all errors, except for notices ; ...
1
vote
1answer
48 views

How to organize files in Linux/Unix shell?

I would like to try to organize my documents, and I was told that I can do this using the linux/unix cygwin terminal. I searched for the command in google but all I ever did find was organizing the ...
0
votes
1answer
58 views

How to run a command on remote host from a service?

I have a service in '/etc/init.d'. In that service, I run a command on a remote machine using ssh as a user. Currently I do this in the following way: sudo -u user bash -c "ssh user@172.21.6.70 ...
0
votes
0answers
27 views

Multicore benchmark

I'm looking for a way to benchmark a multi-core CPU. I found this #!/bin/bash echo "scale=$1; a(1)*4" | bc -l The first argument is number of digits to calculate. Now we can run in parallel (4 ...
1
vote
5answers
16k views

How to copy a file from a remote network to the local desktop

So I used SSH to remotely login to another computer on a network. I have many files that I would like to copy over to my local desktop. I am trying to follow this How-to : However, I think one ...
2
votes
2answers
69 views

What is happening after kill -CONT <PID>?

I have suspend a process through kill -TSTP <pid>. Then tried to continue it with kill -CONT <pid>. But After completion of process, control is not returning to bash. Why this is ...
2
votes
0answers
613 views

m: command not found

just tried to compile the R-language from sources but my make aborted with m -f liblzma.a make[4]: m: Command not found I eagerly searched the web but it seams it's impossible to find the command ...
2
votes
1answer
49 views

How can I merge 2 disk images into one with 2 partitions?

I have 2 (relatively small) disk images for qemu (raw format) containing different filesystems (say fat and ext4). I want to put them into an usb stick as two different partitions so that I can plug ...
3
votes
1answer
76 views

free command output: gentoo (redhat?) vs debian

I noticed there is a difference between outputs of free command: On debian: $ free -h total used free shared buffers cached Mem: 4.0G 3.4G ...
2
votes
4answers
646 views

Why does the grep command ignore the period in the search string?

The command that I am using: find . -type f -name "*.sql" -exec grep -i -l 'schema_name.' {} + What I want to search is all the files which contain schema_name.. But the find command is ignoring ...
3
votes
1answer
62 views

Is there a way to use regex expressions to auto-fill filenames in bash?

Assuming I have a directory with files as shown: $ ls file0001.txt file0002.txt file0003.txt file0004.txt file0005.txt someotherfile.txt Lets say I want to run the following command: $ cat ...
3
votes
1answer
48 views

Why does path-completion in bash not always work?

With different bash-environments (different installations) I have different behaviors in terms of path-completion when hitting TAB on the command line after . Where is this handled? One specific ...
0
votes
1answer
31 views

(ls) command won't show exact size - Weird output [closed]

I am trying to find the size of the files on my hard drive in exact bytes, but whenever the size gets too big the number turns all weird (like 1.98329e+12). Can I stop it from doing this or convert ...
3
votes
1answer
89 views

Syntactic differences in cp -r and how to overcome them

Let's say we are in a blank directory. Then, the following commands: mkdir dir1 cp -r dir1 dir2 Yield two (blank) directories, dir1 and dir2, where dir2 has been created as a copy of dir1. ...
18
votes
5answers
11k views

Make cd automatically ls

I find that I often do the following: %> cd bla/bla %> ls I would like it that whenever I cd into a directory it automatically does an ls. I fiddled with my .bashrc for a while, but couldn't ...
0
votes
3answers
597 views

Can dash replace bash as my default shell?

From what I read, dash can be made as a shell by using the command ~$ chsh shirish Password: Changing the login shell for shirish Enter the new value, or press ENTER for the default Login Shell ...
1
vote
1answer
39 views

Get windows' titles using command line

Is it possible to get the titles of all the running GUI application windows via CLI? The titles which are also shown on the task bar buttons. For example: Firefox: cPanel X - Main Nautilus: File ...
5
votes
1answer
82 views

Performing atomic write operations in a file in bash

After going through the bash documentation, this question and this one it's still not clear to me how can I perform atomic write (append) operations to a file in bash. I have a script that is run in ...
0
votes
1answer
47 views

mv misbehaves in shell script [closed]

I have the following folder structure: /backup /backup/copy.sh /backup/archive/ /backup/20160405_logs/ /backup/20160405_logs/sql.log /backup/20160405_logs/bak.log I want to move the folder ...
0
votes
1answer
47 views

Column comparison using awk [duplicate]

I would like to compare the first column of file1 with the second column of file2 and only if they match it should display any matching lines in file2 only as the output. The columns are separated by ...
12
votes
3answers
2k views

What are the characters printed when Alt+Arrow keys are pressed?

When I press AltUp, A printed to terminal screen. Same thing happened when I pressed AltDown but B is printed instead. Other characters that I realized; AltLeft = D and AltRight = C What is the ...
0
votes
0answers
30 views

Syncing two folders between two Linux workstations (Two different networks)

I have two Linux work stations: Workstation A at home Workstation B at work The workstations are linked to the internet and they don't belong to the same network. How can I sync a folder "Test" ...
0
votes
0answers
21 views

du -sh * discrepencies [duplicate]

Can someone explain why the following results do not add up. I just rebooted and logged in, and I have the following: As root: du -sh /home/* 7.8G /home/mike 4.0K /home/Systemback `du -sh ...
11
votes
3answers
32k views

How to avoid the need to issue “y” several times when removing protected file

I'm looking for a solution to be used as a response to "rm: remove write-protected regular file [x] ?" I was thinking of issuing a character followed by carriage return for several amount of times, ...
23
votes
6answers
27k views

How do I limit the number of files printed by ls?

Is there a way to limit the quantity of listed files on a ls command? I've seen: ls | head -4 but to get head or tail to be executed I need to wait for ls to finish execution, and with directories ...
0
votes
1answer
32 views

Is there a command-line application that combines SSH and SFTP? [duplicate]

When I'm working on some remote host via SSH, I often need to upload or download files. With my current setup, I need to switch to another terminal and conjure up rsync or sftp, which can be a pain ...
0
votes
2answers
44 views

Extracting a certain folder from a tarball - how do I tell it where to put the file once extracted?

I've looked around at multiple sources for this question and I know how to extract the file, but neither source told me how to state where to put the folder once it has been extracted. I tried this: ...
0
votes
0answers
45 views

How do I extract subtitles from Video files?

I want to use the command line to extract subtitles from video files. I want to extract subtitles from a lot of files. That is why I want a CLI tool. Ideally it should work with any video format ...
1
vote
2answers
222 views

Aircrack-ng: No /pentest/passwords/wordlists/darkc0de directories

this is my fist question on this forum. I'm currently using Linux Mint 17.2 Cinnamon and trying to run Aircrack-ng to show the password of my own Wi-Fi connection, I got the Handshake too. The problem ...
3
votes
3answers
127 views

Add mtime to grep -c output and sort the output by mtime

I have a directory full of logs named in the following style: info.log00001 info.log00002 info.log00003 ... info.log09999 info.log My current output (using grep -c) I need to analyze the ...
0
votes
1answer
25 views

Excluding files whilst using tar to zip site contents not working [closed]

I'm trying to zip the contents of a site using tar and exclude a bunch of folders and error_log files but it doesn't seem to be working, when it's processing I still see many of the excluded files ...
1
vote
1answer
57 views

Why does terminal say it's installing a package that's already installed, when I try to install something completely different?

I'm on Fedora 23 MATE. I tried to install virtual box an hour ago but it wouldn't because their website is down. I had also installed gyazo. That had no issues. Now when I try to install ...
11
votes
5answers
37k views

Move all files with a certain extension from multiple subdirectories into one directory

I have a bunch of .zip files in several directories: Fol1/Fol2 Fol3 Fol4/Fol5 How would I do move them all to a common base folder?
0
votes
1answer
36 views

Copy process output few lines to a file

I want to copy the xinput-calibrator output to the temp.txt file from my Qt application. I am starting the QProcess from the Application Using the command xinput_calibrator | tee log.txt, I am ...