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

learn more… | top users | synonyms (1)

2
votes
1answer
39 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 ...
0
votes
1answer
27 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
48 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 ...
0
votes
1answer
52 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 ...
2
votes
4answers
631 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 ...
2
votes
2answers
61 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 ...
3
votes
1answer
36 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 ...
3
votes
1answer
49 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 ...
0
votes
2answers
33 views

Compare and return first instance of n characters from a list

Lets say I have the output of this command saved to a file. cat /dev/urandom | tr -dc '[:graph:]' | fold -w 1000 | perl -pe 's/(.)(?=.*?\1)//g' | head -n 50 I would like to compare only the first n ...
5
votes
1answer
60 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
45 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 ...
1
vote
1answer
31 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 ...
0
votes
1answer
42 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 ...
0
votes
0answers
29 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 ...
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
41 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
27 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
1answer
44 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 ...
0
votes
1answer
23 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 ...
0
votes
1answer
42 views

Tried to install Nvidia drivers, now I can only boot to tty [duplicate]

I'm on Fedora 23. I followed this guide and got all the way up to the "2.7 Reboot to runlevel 3" step. I did that step then rebooted and now I can only boot into tty. I tried to continue on with ...
3
votes
3answers
119 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 ...
-1
votes
0answers
65 views

How to write a shell script (.sh file) in CentOS 6 to run commands in different tabs in the same terminal

My commads.sh file so far, #Start the first service cd /home/user/service1 java -jar service1.jar sleep 5 #Start the second service #I need this to start in another tab (if cannot another terminal) ...
-2
votes
0answers
14 views

Will zip -r command on remote server be cancelled if I exit terminal? [duplicate]

I have done a lot of Googling, and cannot find an answer. I have made a "zip -r home" request on my server via my terminal. The home directory is over 30GB. I need to leave the office at some point ...
0
votes
1answer
33 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 ...
7
votes
4answers
831 views

Is it possible to name a part of a command to reuse it in the same command later on?

If I want to move a file called longfile from /longpath/ to /longpath/morepath/ can I do something like mv (/longpath)/(longfile) $1/morepath/$2 i.e. can I let the bash know that it should remember ...
-8
votes
2answers
89 views

What does the cd /etc command do?

I was asked the question "what does the cd /etc command do?". This is my answer: This command cd /etc changes directory to the directory specified after the slash /. The /etc refers to a folder in ...
3
votes
1answer
29 views

rlwrap: tclsh multi-word autocompletion

How do I get multi-word autocompletion with rlwrap for tclsh? Example: I type file <space> then pressing <tab> <tab> I only want to see the sub-commands to file, such as exists ...
3
votes
1answer
37 views

Problem with encoding in shell script

I have the following code: #!/bin/bash task=$1 xml=$(curl -sL "http://login:pass@server.com/issues/$task.xml") id=$(xmllint --xpath '//issue/id/text()' --format - <<<"$xml") name=$(xmllint ...
2
votes
2answers
50 views

cd out of deleted folder

Is there a way to cd out of a directory which has just been deleted (go up one level into the upper folder which still exists? It often happens to me that I have a console opened for a folder, and ...
0
votes
0answers
24 views

how to run android dex from command line in ubuntu 14.04

I write a program which has ant build file with this command: <exec executable="dx" dir="${workdir}"> <arg value="-JXmx${env.JavaHeap}"/> <arg value="--dex"/> <arg ...
2
votes
1answer
27 views

Insert string or line after last instance of a specific search variable, in a loop

I'm wondering if someone could help me with a specific coding question. I have a DNA sequencing file that reads something like this (as an example): ...
-9
votes
1answer
48 views

Unix “ls” command? [closed]

Can someone explain to me what are all the options available with the -la flags for the ls command ? I have read the man pages, but still not sure.
1
vote
0answers
34 views

Find list items in other file [duplicate]

I have one file with hundreds of unique IP addresses (each on a separate line) from which a bot tries to login to one of our services. I would like to see which of these addresses appear in another ...
0
votes
1answer
50 views

Shell script - creating and assign to groups advice needed on my script

Where could I include man useradd and -g and G i'm not sure where to include these commands above. The current shell script doesn't successly create the user but does run. #!/usr/bin/env bash ...
-1
votes
4answers
34 views

How can I address the path/file I just specified again? [duplicate]

Say I'll start writing sudo cp /etc/var/more/evenMORE/fileABC and as the target of the copying, I'd like to define the same folder, except just a different filename (whether it is a new name like ...
4
votes
4answers
434 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: ...
0
votes
0answers
24 views

Is there a common way to render out pdf files in a human-readable format on the command-line and keep the general layout?

I'm imagining something deeper than pdftotext (part of poppler-utils), because what I was imaging would be possible, would be to retain most of the layout on a virtual page, e.g. pipe this through a ...
0
votes
1answer
34 views

How can I access the history buffer in sh? (not in Bash)

Is there a command history in sh, for example how to access it, and as well, how to ensure it is clear? To clarify shells here: let's say you've logged on to a non-Gui Linux system, and $SHELL is ...
1
vote
1answer
47 views

Is bash command line interpreter implemented on emacs?

I'm investigating the relationship between bash and emacs shorcuts. Someone told me that the reason why they're similar is that bash uses emacs as its command line interpreter. However, I haven't ...
1
vote
2answers
32 views

Search for processes which are CPU consumming

I can track the process launched by the user4 with awk: ps aux | awk '$1~/user4/' And also to track what process consume more than 10% CPU: ps aux | awk '$3> 10' Hoe the question is not too ...
0
votes
5answers
54 views

Remove the latest modified file

I have created two files: sample.txt and sample.txt  (the second file contains some hidden characters, e.g. a space). How can I remove the latest modified file? I'm using Linux.
0
votes
1answer
36 views

How to force an application to use a specific cpu? [duplicate]

For example : To build a kernel we can use make it will take more than one hour , to accelerate the process we can use make -j4 all this may finish almost four times as quickly. Generally : How to ...
0
votes
2answers
50 views

why is btmp not showing the username of logged in users?

I am trying to compare the output of the btmp file and who -a commands. I don't know why, but btmp file currently is not showing the username but its showing UNKNOWN in the username field. I am ...
5
votes
3answers
590 views

Remove file, but only if it's a symlink

Ideally I'd like a command like this rm --only-if-symlink link-to-file because I have burned myself too many times accidentally deleting the file instead of the symlink pointing to the file. This ...
1
vote
1answer
38 views

“time > time.txt” refuses to work propely

I just started learning Linux commands. I was experimenting with the > command, that, as far as I understand, makes the command before it write it's output to the file after the sign. This ...
3
votes
2answers
69 views

Modify Openbox key-bindings from commandline

I am using the LXDE desktop environment, which is based on Openbox. I know how to change the key-bindings by editing my ~/.config/openbox/lxde-rc.xml, e.g.: <keybind key="A-F11"> <action ...
1
vote
1answer
26 views

Is there a program that will launch a configurable context menu

I'm looking for something like Zenity or Yad, except I want something that behaves like a menu, namely: it opens right next to the cursor; it takes one click to select things; it's possible to have ...
3
votes
2answers
49 views

On applying commands to groups of lines from stdin

The Unix package datamash supports the application of several summarizing operations to groups of input lines. For example1, here datamash is used to compute the sums of column 2 for each value in ...
2
votes
0answers
376 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 ...