The command-line is the interactive interface to your shell.
-3
votes
0answers
27 views
My site notifice me [on hold]
Can you help me If there any way to notifies me by email when my web site is unresponsive using shell script ?
I try to use manuy script but it dosn't work
0
votes
0answers
17 views
Tab character in exiftool
I have tried everything that I could think of and what I have read here, but its just not working. Down is my one liner and I need help to insert tab character on place of _ between day and hour.
...
-2
votes
0answers
22 views
check validity of input username [on hold]
I want to write a bash script that read an input and then check whether the input
is equal to any users of ubuntu then login else again ask you to enter an input.
function f{
echo"please enter a ...
0
votes
2answers
87 views
Need help with this script which looks up every .c file in the current directory for the strings printf or fprintf [on hold]
Write a script called to look up
1
vote
1answer
15 views
Is it possible for command line to open a website and paste the clip board to a text box?
I have some text in a file copied to the clipboard via command line and I then wish to paste this content to a website.
cat file | pbcopy
/usr/bin/open -a "/Applications/Google Chrome.app" 'http://...
0
votes
1answer
39 views
Bash-Script returning wrong PID
when I'm executing my bash-script, I'm getting the wrong PID. I'm needing the PID to kill the process at the end of it. This is a simplified script that is affected by the issue:
echo 'PASSWORD' | ...
-5
votes
1answer
45 views
how can we write one shell pipeline to merge the content of two files (file1, file2)? [on hold]
how can we write one shell pipeline to merge the content of two files (file1, file2), and sort their contents and display all the lines which start with the word “Chapter” on the console?
-5
votes
1answer
23 views
How can use find to create one shell command to search for a file named foo starting from root directory, [on hold]
How can use find to create one shell command to search for a file named foo starting from root directory, and send the output to a file called fooResult and the errors to /dev/null?
17
votes
2answers
919 views
cat gives different error when opening non-existing file
Both of the following commands try to open a non-existing file foo, but the error messages are a little different. What could be the reason?
$ cat foo
cat: cannot open foo
$ cat < foo
-bash: foo: ...
1
vote
2answers
20 views
Is it possible to specify an at command on a single line?
I'd like to schedule 8 curl commands over the next 12 hours. I was wondering if there's a way to do with with 8 single-line calls to at. Sorta like:
$ at now + 1 min "curl -X POST 'http://localhost:...
0
votes
2answers
30 views
How to remove the lines that have empty fields?
I have a CSV file with multiple columns, comma "," separated and numbers of lines.
some lines have empty one or two fields "Columns". How i can identify in a separate file and/or remove those line ...
-1
votes
1answer
12 views
When printing unique extensions in the directory with the uniq command there are duplicates
for i in *; do echo ${i#*.}; done | uniq -u
Why there are duplicates in the output?
3
votes
2answers
36 views
Extract unique single commands from history
I have created a file called histcopy.txt with the command history,
(history > histcopy.txt). It look somewhat like this:
1. l
2. ls
3. cat necopy.txt
4. netstat
5. cd | ls-l ; grep -i "3" ...
1
vote
2answers
16 views
Find files in globbed directories excluding some subpaths
Consider this directory (and file) structure:
mkdir testone
mkdir testtwo
mkdir testone/.svn
mkdir testtwo/.git
touch testone/fileA
touch testone/fileB
touch testone/fileC
touch testone/.svn/fileA1
...
2
votes
1answer
20 views
How I can find line(s) which the third columns is not digit/date?
I am trying to use awk command to find line(s) which the third columns is not digit/date? Suppose there is a file comma "," field separated, has three columns and as code "," measure "," dd/mm/yyyy,
...
3
votes
1answer
15 views
Keychain Password Removal Command
Looking for a little guidance on removing all instances of a generic password keychain by either the service (svce) or label string. I can do it once at a time but I sometimes have machines that have ...
-2
votes
0answers
35 views
How to pass a user input into a command line application via the command line arguments?
I have a command line application which requires a user input:
./some_application
# something happens here.....
# something happens here too.....
Enter secret pass phrase:
I want to call it from a ...
-3
votes
0answers
46 views
Unix file compare! [closed]
I have two files File A & File B. For example:
fileA:
1 a1 b1 c1 d1 e1
2 a2 b2 c2 d2 e2
3 a3 b3 c3 d3 e3
4 a4 b4 c4 d4 e4
5 a5 b5 c5 d5 e5
fileB:
2 b2 c2 e2
4 b4 c4 xx
5 b5 c5 e5
As ...
-2
votes
0answers
28 views
How to override system commands? [closed]
How do I override system commands? For example, I want to override the ls command to hide files inside a directory or notify me every time rm -rf is executed.
And so on I already seen aliases and LKM, ...
-2
votes
1answer
38 views
Confused about pipes: (Making a “3 commands pipe”.) [closed]
So I have to make a pipe which consists of 3 commands:
A program written in c that prints a text in an infinite loop -
after compiling it's called a.out
it could be anything, for example xcalc
...
1
vote
1answer
11 views
xwd output - unknown header
The output I get from a capture of the file browser:
xwd -name "CVandXdo - File Browser" -out capture.xwd
Doesn't match the specification defined for xwd files:
http://www.fileformat.info/format/...
0
votes
0answers
21 views
''Rats, that failed, you may have to do it manually" you you [closed]
I'm trying to configure Sup-mail with the command-line sup-config, but it failed. I got the message Rats, that failed, you may have to do it manually. Could anyone be able to tell me how could I fix ...
1
vote
3answers
14 views
Revert setting the keyboard layout
I'm running a raspberry pi 3.0 on rasbian jessie lite and using a flat mac keyboard with the number pad on the right side. I do not have a GUI interface.
I went to change my keyboard layout because ...
-6
votes
1answer
52 views
How to create new script , role like wc [closed]
I would like to create a new .wc command , but I have no idea how to proceed.
Can you help me?
3
votes
2answers
57 views
How can a space-delimited list of words be folded into tabular columns that fit in the terminal's width
I would like to output a series of space-delimited words in a tabular format, filling line by line so that nothing exceeds the terminal's width but the available space is used optimally, like this:
+-...
1
vote
1answer
39 views
Fork Bomb: Why Piping Output Into Another Copy of Fork Bomb works if no Output is returned? [duplicate]
I understand the basic syntax of this famous fork bomb : ( ) { : | : & } ; : but I am currently struggling to understand the part of : | :, where one pipes the output of : to another :.
What I do ...
1
vote
0answers
11 views
How can I open a debugfs on a partition in an image file?
I am trying to open a debugfs on an image obtained from dd. I'm interested in the 3rd/5th partition.
Number Start End Size Type File system Flags
1 32256B ...
1
vote
3answers
26 views
Find all files, create CSV with one row per subdirectory and file names in collumns
I have a directory with subdirectories and files structured like this:
01/fileA
01/fileB
01/fileC
02/fileD
02/fileE
03/fileF
03/fileG
03/fileH
04/fileI
I'd like to get a CSV that looks like this:
...
1
vote
1answer
24 views
How to run the executable file to convert the extension of multiple files in Linux command line? [closed]
I use (./executablescript filename ) to convert the file format. It works for a single file. But, If I need to do it for multiple files, I get the error message "multiple occurrences". How can I run ...
1
vote
1answer
14 views
find matching file and change dirname path
I need to find a very efficient way of moving a file of matching -mtime from one directory tree to another directory, maintaining the same subdirectory path where it doesn't exist yet.
eg. move /dirA/...
3
votes
2answers
55 views
How can I access a Vim process after closing its terminal on macOS?
This what I get when I run the ps command:
$ ps
PID TTY TIME CMD
14777 ttys000 0:00.25 -bash
19716 ttys000 0:00.15 vi templates/base.html
8240 ttys001 0:00.11 -bash
8284 ...
1
vote
2answers
48 views
Piping a non-constant amount of commands [closed]
piping commands is fairly straightforward once the number of commands n is fixed.
For example (n=2)
echo Hello | grep llo
But let's say the number of commands may vary. It will only be known at the ...
1
vote
2answers
31 views
Raspbian: play video through HDMI from command-line
I have a raspberry 2. I installed raspbian OS (only terminal) on it. I plugged in a HDMI cable, but it seems that it's not working. When I try to run video(or something) in command line nothing ...
0
votes
1answer
65 views
Command works when copied and pasted but not in a bash script?
I'm trying to pass a windows command into a linux netcat shell and then read back the output.
So far I have:
cat <( printf 'ipconfig\n' )| nc -v 137.148.70.243 443
Which when copied and pasted ...
1
vote
2answers
32 views
Xterm “color query” doesn't print anything
I'm trying to programmatically query the background color of my terminal with
echo -ne "\e]11;?\a"
but the output appears blank. The issue arises using both Terminal.app and iTerm 3, in both Zsh and ...
3
votes
1answer
43 views
What Type Of Data does the Input File Contain?
I have a folder with more than 10000 text files. The files can be of two types:
Type1: called “DNA”
Format:
header information starting with “>”
Line 2 onwards contains only the following letters:...
0
votes
1answer
30 views
Change GTK theme from command line
I was able to change my GTK theme with lxappearance but would prefer to know the command (or multiple commands, if GTK2 and GTK3 themes need to be set separately).
At the moment, I'm on an Ubuntu ...
6
votes
1answer
57 views
Programmatically redirect audio output of specific program to file
I would like to redirect the audio output of a program to file, on the command line, like in
$ redirect-wrapper file.wav my-program
so that
I don't hear the output of the program, i.e. the output ...
0
votes
1answer
37 views
cat filename | cut -f2 | head -1 > newfile contains more characters than expected
When I run:
cat filename | cut -f3 | head -1
I get the following result:
apple
However when I save this to a file by using:
cat filename | cut -f3 | head -1 > newfile
I then open this using ...
0
votes
0answers
29 views
change Cinnamon hot corners via command line - gsettings
I am using Linux Mint 18 Cinnamon edition.
I am trying to change my hot corner settings via command line. I used dconf watch / to obtain which value to change - it appears that currently I have this ...
3
votes
4answers
107 views
Check logical volume mount point (command line)
With GNOME Disks utility, I can check whether a logical volume is mounted:
And where is it mounted:
How can I get this information from the command line? Having, for example, the logical volume UUID,...
-3
votes
2answers
62 views
How to write bash script to open vi and edit document?
I'd like to write a bash script that essentially automates this process:
vi filename.pdf
(open "filename.pdf" using vi)
:4,7d
(in vi command mode, delete lines 4-7)
O
(in vi command mode, tap ...
0
votes
1answer
17 views
subset files in a folder based on a list
I have a folder "all_images/" with more than 1000 image files named as "Image1.tif", "Image2.tif" and so on..
I have a text file "extract_images_list.txt" which is a list of images that I want to ...
2
votes
1answer
55 views
mispelled command in UNIX?
I don't remember a UNIX command that allowed you to remember how to write correctly a command.
Let's supose that the command that I say is called MISPELL
So running MISPELL will produce the ...
4
votes
0answers
15 views
VLC in background and display it only via HDMI
I run VLC player and It starts in my command line as well, how to run It in background and to output only via HDMI? Raspbian OS (Raspberry)
1
vote
1answer
21 views
copy files remotely on same path
I have thousands of csv files in some directories. Out of which I would like to copy one csv file to remote machine on same path, if remote machine doesn't have directory then it should create ...
8
votes
5answers
752 views
Reverse a hexadecimal number in bash
Is there a simple command to reverse an hexadecimal number?
For example, given the hexadecimal number:
030201
The output should be:
010203
Using the rev command, I get the following:
102030
...
1
vote
2answers
54 views
How to compose next command while previous is executing?
While working in bash (usually with git), what often happens to me is that I start some command and while that command is executing (which could take a while), I want to start composing the next ...
7
votes
3answers
269 views
How can I check to see if a process is stopped from the command-line?
I have the pid and I just stopped a program using
kill -stop PID
Now I want to continue it by doing
kill -cont PID
But only if it's already stopped. How would I check to see if it's stopped or ...
2
votes
3answers
163 views
How do I sort files into a sub-folder based on filename part?
These are the files in the directory:
Ford-Mustang-001.jpg
Ford-Mustang-002.jpg
Ford-Mustang-003.jpg
Chevy-Impala-001.jpg
Chevy-Impala-002.jpg
Chevy-Impala-003.jpg
I would like to sort these into ...