Tag Info

New answers tagged

0

On systems with 'awk' try awk 'BEGIN{ print "\a" }' was the only one to work for me.


0

Other answers apply in a general case, but as you mention that rsync is a source of the problem, you may just need to tune its invocation. For a start, the popular -a flag makes rsync copy permissions; use -r istead of -a or add -no-p (for no permission sync) and -no-g (for no group sync). Also rsync supports --chmod flag to alter permissions on newly ...


0

Caution deletes all the Files & Directories above 1GB in the given path du -sh -t1000000000 /some/path/* | awk -F" " '{print $2}' | xargs rm -rf


0

There are many ways to do first way: zip example zip cw3.zip *.sh The above command will zip all *.sh files in cw3.zip second way: If you want to zip all files which are in sub directories as well zip -r example zip cw3.zip *.sh


0

When using Java is an option for you, try log-merger: java -jar log-merger-0.0.3-jar-with-dependencies.jar -f 1 -tf "HH:MM:ss.SSS" -d "," -i log1,log2 01:02:03.6497,2224,0022 foo foo1 2foo foo3 01:03:03.6497,2224,0022 FOO FOO1 2FOO FOO3 01:04:03.6497,2224,0022 bar 1bar bar2 3bar


0

A oneliner answer that I'm using to keep track on a file change: $ while true ; do NX=`stat -c %Z file` ; [[ $BF != $NX ]] && date >> ~/tmp/fchg && BF=$NX || sleep 2 ; done You don't need to initialize BF if you know that the first date is the starting time. This is simple and portable. There is another answer based on the same ...


1

They are sub-interfaces. These are "logical" interfaces, so interfaces over a physical interface. As you can see, at the left side of the dot there is eth4, and at the right side the sub-interface ID. There might be many sub-interfaces over a single physical network card. Each of these sub-interfaces may have its own IP address, netmask, gateway and other ...


0

Simmilar to slhck's Answer, but relying on file operations instead of command invocations: MYPID=1 cat "/proc/$MYPID/comm"


0

Type ps command it will show something like this ps PID TTY TIME CMD 598070 pts/6 0:00 -ksh 671970 pts/6 0:00 vi struct.c 680160 pts/6 0:00 ps u can kill the process then try.. i hope it will solve your problem


0

Add the following keybindings to your .zlogin: bindkey '\e[3~' delete-char bindkey '^r' history-beginning-search-backward bindkey '^g' history-beginning-search-forward bindkey -s '^l' '^qcls\n'


0

How can I create a shortcut that launches Urxvt with set DISPLAY=0? Add the following to ~/.bashrc: export DISPLAY=:0 Note: DISPLAY should be set to :0 not 0 Making Permanent Environment Variables: Environment variables are variables that any command, program, or script can access. If a variable is set in a script, only that script can use ...


0

Just use: lscpu Sample output: $ lscpu Architecture: x86_64 CPU op-mode(s): 32-bit, 64-bit Byte Order: Little Endian CPU(s): 4 On-line CPU(s) list: 0-3 Thread(s) per core: 1 Core(s) per socket: 4 Socket(s): 1 NUMA node(s): 1 Vendor ID: GenuineIntel CPU family: 6 ...


0

Here's the full answer that I made according to my needs. Works only in bash or zsh, because I'm too lazy to get it written in perl. Code #!/bin/zsh mkv_sub_getshort() { sub=$1 sub="${sub%.${sub:e}}" sub="$(sed 's/^.*[[:punct:]]//g' <<< "$sub")" echo $sub } mkv_maker() { local c=0 for i in *srt; do ...


0

The sample you gave have 3 lines but your topic emphasize on N lines of input, so I would assume that 3 lines is only for illustration purpose, and what you really need is that N lines of input, which could be as much as over 10, which in turn making that accepted bash script unmanageable. There are simple built-in commands to do this, without diving into ...


3

If you're lucky enough to have no spaces in the input, then xargs -n3 echo |tr ' ' , would do it.


3

The root user in linux/unix systems can write to a file even if the write flag is not set. Therefore he can change the contents of /etc/shadow or any other file independent from it's permissions. The passwd utility has the setuid bit set. See with: ls -la /usr/bin/passwd It should look like this: -rwsr-xr-x 1 root root 42824 Sep 13 2012 /usr/bin/passwd ...


1

Using ffmpeg: ffmpeg -i video.mp4 -i subtitle1.srt -i subtitle2.srt -map 0 -map 1 -map 2 \ -c copy -metadata:s:s:0 language=eng -metadata:s:s:1 language=ipk output.mkv This will stream copy (-c copy) all streams, so re-encoding is avoided. The default stream selection will only choose one stream per stream type, so -map is used to manually override that. ...


0

I suppose netstat is not working either? I had this same thing happening to me on Linux, but a long time ago (I'm pretty sure it was kernel 2.0.36). The port was hooked on my eth1. What I did was to disable the network adapter and re-enable it a couple of seconds later. That 'cleared' the kernel structures that held the port in its "half-open" state. I ...


2

Copy text from one file to another with nano text editor Note: To help you understand better, we will use a source file: /var/named/athens.local destination file: /var/named/patra.local Open the destination file (the file that want to paste the text into), by using nano's multiple buffer. nano -F destination_file So we have: nano -F ...


1

Just so long as the permissions were in place before the tractor process was started it will have access to the file 'holo' because it's part of the 'vulcan' group. If you start the tractor process then add the 'spock' user to the 'vulcan' group it may not work.


0

D, you haven't described the situation around the issue, but here goes, First does the directory appear in your file manager? According to your listing d????????? ? ? ? ? ? Downloads The directory "exists" but, without any discernable/set/assigned permissions, nor does it belong to a user or a group. In fact, on the face of it, read ...


0

export and echo at the same time root@kali:~# echo ${SOMETHING=1} 1 root@kali:~# echo $SOMETHING 1 root@kali:~# unset SOMETHING root@kali:~# echo $SOMETHING root@kali:~# echo ${SOMETHING=1} 1 root@kali:~# Another goofier example xD root@kali:~# echo ${SOMETHING=1} ${PLUS=+} ${SUMTHIN=2} ${EQUALS==} && expr $SOMETHING $PLUS $SUMTHIN 1 + 2 = 3 ...


2

Your file is probably in some utf-16 encoding. Run the file command on the file to find out. If it comes from microsoft it is probably utf-16 little-endian. You could then convert it to utf-8 which is easier to awk with by doing on the file: iconv -f UTF-16LE -t UTF-8


2

you can simply start your bash with the --rcfile /path/to/script flag. to be specific, use sudo -u $USER bash --rcfile /path/to/file make sure not to cover bash --rcfile /path/to/file by double quotes, because if so, sudo will not find the bash command. You could also make a function containing that with the user as parameter $1


2

what about tree? "Displays the contents of the current directory and subdirectories in a tree." it should display in the format you'd like, the link contains syntax and example output: user@comp:~$ tree ./images ./images ├── archlinux-2015.05.01-dual.iso ├── kubuntu-201505081004-amd64.iso ├── livecd.iso ├── ubuntu-14.04.2-desktop-amd64.iso ├── ...



Top 50 recent answers are included