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

learn more… | top users | synonyms (1)

0
votes
1answer
42 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
845 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
186 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
2answers
61 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
41 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
55 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
46 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
29 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
52 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
64 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
68 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
35 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
490 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: ...
1
vote
0answers
28 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 ...
1
vote
1answer
58 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
48 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
33 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
73 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
41 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
81 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
636 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
41 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 ...
4
votes
2answers
85 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
29 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
51 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
739 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 ...
0
votes
1answer
44 views

Unable to detach a USB device on Ubuntu 14.04

I was using udisks to unmount and detach usb device with following commands which works just fine on Ubuntu 10.04 udisks --unmount /dev/sdb1 udisks --detach /dev/sdb Because udisks is not available ...
0
votes
0answers
22 views

How to recover content of the file in unix? [duplicate]

I accidentally gave cat >filename instead of cat filename and my content is lost.Now I have only my file,but content is deleted.How to recover the content alone? Please help me to get back the content....
0
votes
1answer
46 views

Unix, create file based on command [duplicate]

I have a command, but I want to get the results into a .txt file I can open. How do I alter my command to allow the results to be put into a text file. I plan to transfer this .txt file to my local ...
1
vote
0answers
25 views

How to connect to wifi using nmcli with a static IP address and password?

There is info on how to connect to ethernet(eth0) with nmcli using a static IP, but nothing on how to connect to wifi (wlan0)? This sets up a connection profile but how to add the password and ...
3
votes
1answer
41 views

Argument list too long when running ls -d “$PWD”/* command

I'm trying to execute ls -d "$PWD"/* > formmlFileList43k.list But I get the following error: bash: /bin/ls: Argument list too long I've read using a pipe won't have such limitation, how can I ...
1
vote
2answers
59 views

Retrieve name of the active network interface only [duplicate]

How can I retrieve from the command line (or a shell script) only the name of the active network interface, in Linux? If there are several active interfaces, I want just one (selected arbitrarily).
0
votes
2answers
22 views

how would I convert this interface block into a command

I tried this: ifconfig br0 192.168.0.1 broadcast 192.168.0.255 netmask 255.255.255.0 network 192.168.0.0 gateway 192.168.0.1 up But it did not work I am trying to use all of these parameters: ...
0
votes
2answers
65 views

How do I find a range of numbers in the content of file and move files containing the range of numbers to another directory?

Okay so I have about 90 files, each with a body like 187942 78.9 I want to filter files that has the values between 70 to 90 on the second column and move them to another directory. I'm ...
0
votes
0answers
41 views

How to split a A4 Letter page pdf into 2 4x6 pdfs

I get pdfs in A4 Letter size in portrait orientation, they have 2 sections top and bottom each 4x6. Right side of pdf is blank. I need to spit them into 2 pdfs 4x6 or 2 pages of the same pdf.. Ive ...
1
vote
1answer
28 views

Packages and the like for configuring new systems [closed]

I'm faced with the prospect of moving from a server which has been configured previously with loads and loads of the sorts of tools you forget about day-to-day as you do various tasks (I'm talking ...
0
votes
1answer
77 views

Create a symbolic link in the current directory

I have got a question were I have to create a symbolic link named "new" to file /test/test1/test2. The current command I have is this: ln -s /test/test1/test2 /new I am not if there is a specific ...
0
votes
1answer
90 views

Downloading an attachment from Inbox using the command-line

Please help me figure out the right program to use to solve the following: Everyday I have a report emailed as a PDF attachment to my inbox. The subject is the same, and it is from the same email ...
0
votes
2answers
43 views

How to pick a random element from the output of a command?

if I have sth. like echo 1 2 3 4 5 6 or echo man woman child what do I have to put behind the pipe to pick out one element of 1 2 3 4 5 6 or man woman child ? echo 1 2 3 4 5 6 | command 3
1
vote
2answers
64 views

how to move all files from a pipe into a directory ?

I performed a file-command on all elements in my Desktop directory: ~/Desktop > file * then I grepped all the lines who have the string "image" in the description: ~/Desktop > file * | grep ...
0
votes
0answers
25 views

Uninstall package from command line in unbootable system

I messed up my Raspbian Jessie system by installing upstart, and now it gets hung up while booting. Now I'm trying to get back to a bootable system by uninstalling it. I used these directions to get ...
-1
votes
3answers
94 views

Shell scripting : want to login on some server, which are in same domain and execute command and exit

I have 10 unix servers, I want to log into them one by one, execute 4-5 lines of code, save the output and exit. For Example: 10 serves: Intially at xyz server Login in server 1 --> execute 4-5 ...
3
votes
2answers
162 views

Why the defined path is used as file name when I transfer files through scp to a Windows host?

When trying to copy a file from Linux (Raspbian to be precise, though I don't think it matters) to Windows using SCP: scp a.txt {user}@{ip}:\C\Users\{user}\a.txt The file is copied, but to C:\Users\...
0
votes
0answers
29 views

SSH Automation - Dynamically execute Script over SSH [duplicate]

Is there any tools do dynamically control with a local script a ssh session. So I can control the key pressed, wait some time, control the output. Something like AutoIt for Windows in the Linux/SSH ...
3
votes
3answers
136 views

Using /dev/random, /dev/urandom to generate random data

I'm looking for ways to use /dev/random (or /dev/urandom) from the command line. In particular, I'd like to know how to use such a stream as stdin to write streams of random numbers to stdout (one ...
4
votes
1answer
41 views

I am stuck connecting to the internet via a usb wifi stick

I am trying to set up a an internet connection through a usb wifi sticker in Linux. Here's the sequence I tried: iw dev This returns the name(?) of the Interface that I want to connect to: phy#0 ...
0
votes
1answer
34 views

command line in su - and background

I am writing a simple unix script to automate reading of a log file. The following does not give any output to the terminal. It just asks for the password for buser and then it just hangs. I ...
22
votes
8answers
1k views

Clipboard for copying and pasting files in command line?

In Bash, suppose I visit a directory, and then another directory. I would like to copy a file from the first directory to the second directory, but without specifying the long pathnames of them. Is it ...
0
votes
2answers
78 views

How to use cd command in su command?

In the below script the cases aserver and bserver work fine. But in case "cserver" above, after su - gsxuserp, I need to perform the following three options with the same user. cd .. cd ...
0
votes
3answers
283 views

Help with tr command

Assume that the file ft has 25 lines of text. Explain the command: tail -15 ft | tr "a" "A" > ft and tell me how many lines the file ft has after the execution of the command. I understand that ...