Tag Info

New answers tagged

0

Replace Exec=/var/tmp/runme.sh with Exec=sh /var/tmp/runme.sh


0

Just Create DOS Batch File with Following code and save and run @ECHO OFF color a set /p ipaddress= Type IP address to Troubleshoot = :LOOPSTART ping -n 1 %ipaddress% | for /f " tokens=*" %%a in ('findstr "Rep Req"') do Echo %date% %time% %%a >>C:\Ping%ipaddress%.txt GOTO LOOPSTART


0

One solution is to use lynx -dump, as in lynx -dump file.html or echo "<div>this is a div</div>" | lynx -dump -stdin Better: Use w3m -dump, it respects the page layout. It is awesome. sudo aptitude install w3m w3m -dump file.html echo "<div>x</div>" | w3m -dump -T text/html You can set the number of columns of the terminal ...


2

bzr lp-propose and bzr lp-propose-merge are the same command (lp-propose being an alias of lp-propose-merge): $ bzr lp-propose --help Purpose: Propose merging a branch on Launchpad. Usage: bzr lp-propose-merge [SUBMIT_BRANCH] Options: --staging Propose the merge on staging. -v, --verbose Display more information. -R ARG, ...


0

I've solved it. For anyone interested, it was a combination of simple syntax error and having to: Put the script, named extract.sh, in /bin/extract (without .sh) Add an alias as such to .zshrc: alias extract="/bin/extract" Have the following lines in .config/ranger/rifle.conf (the syntax error :): ext 7z|ace|ar|arc|bz2?|cab|cpio|cpt|deb|dgc|dmg|gz, has ...


8

pts/0 is a Pseudo-Terminal Slave (See What does "pts/" in the output of w mean?). The (:0) tells you which display you're using. the +,-,? tells you whether a user/tty is accepting messages. If true, display a + for each user if mesg y, a - if mesg n, or a ? if their tty cannot be stat'ed. See the mesg man page: NAME mesg - control ...


3

If all you want to do is show a clock, just use date: while :; do date +%r; sleep 1 ; done That will show the time every second until you stop it with CtrlC. If you want it to be on the same line (the above will print a new line every second), do this instead: while :; do printf '%s\r' "$(date +%r)"; sleep 1 ; done


1

I really like the ncmpcpp clock feature, triggered by 0-key (see screenshot). For more detail on the installation procedure, please refer to this post.


1

Edit your ~/.bashrc file. I prefer editing it with nano, so nano ~/.bashrc Here's the portion of my own edited file: if [ "$color_prompt" = yes ]; then PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\$' else # PS1='${debian_chroot:+($debian_chroot)}[*\u@Ubuntu*]:\w\$ ' ...


5

If you want to display running time in your terminal you can use this command. It will display time in the upper right side of your terminal. while sleep 1;do tput sc;tput cup 0 $(($(tput cols)-11));echo -e "\e[31m`date +%r`\e[39m";tput rc;done & But note that displaying time using this command sometime may overlap the text present in terminal. So ...


1

The answer by @scai at this Unix and Linux question is still correct. From lib/connect.h: #define DEFAULT_CONNECT_TIMEOUT 300000 /* milliseconds == five minutes */


0

you should be able to achieve this with startxfrom the TTY. If this is not the case you should be able to set that up by creating or editing the .xinitrc in your home directory and using the startx command. I'm not sure if this is set up in Ubuntu by default or by some other means but there is some useful information On the Archwiki


9

/ and // are pointing to same directory. See repeated slahes in a path are equivalent to a single slash This behavior is mandated by POSIX and most applications follow suit. The exception is that “a pathname that begins with two successive slashes may be interpreted in an implementation-defined manner”. What you're seeing is not, in fact, Linux ...


2

And the python option: regardless if all words are in one line or on separate lines: #!/usr/bin/env python3 import sys f1 = sys.argv[1]; f2 = sys.argv[2] def read(f): with open(f) as content: return content.read().split() for item in [w for w in read(f1) if not w in read(f2)]: print(item) Copy the script into an empty file, save it as ...


0

Found the solution: tmux new -d 'watch gedit'


2

This is very simple to do but your life will be much easier if you have one name per line instead of a space separated list. There are many excellent utilities for manipulating text files in Linux, it is one of the things that all *nixes excel at, but most expect one item per line. So, most of my solutions will start with modifying the files accordingly. ...


2

If they're sorted and separated by newlines, you could use comm show you the lines that are unique to file1: comm -23 file1 file2 A demonstration: $ comm -23 <(echo -e 'john\nmike\nanna\npaul\nlaura'|sort) <(echo -e 'john\nmike\npaul'|sort) anna laura Or you could diff to do much the same thing (the grep is looking for line deletions): diff ...


5

The clean way would be to create a .desktop file for your script and then make it the default text editor. Create a file called /usr/share/applications/foo.desktop with the following contents: [Desktop Entry] Name=foo Exec=/usr/bin/foo.sh %U Terminal=false Type=Application MimeType=text/plain; Make it the default program for the text/plain mimetype: ...


3

I would do it in this way: cat myfile.xml | sed '/<!--.*-->/d' | sed '/<!--/,/-->/d' > cleaned.xml Or: awk 'in_comment&&/-->/{sub(/([^-]|-[^-])*--+>/,"");in_comment=0} in_comment{next} {gsub(/<!--+([^-]|-[^-])*--+>/,""); in_comment=sub(/<!--+.*/,""); print}' Or: xmlstarlet ed -d '//comment()' file.xml


1

As others have said, find's -exec needs to be terminated. However I would actually suggest using + instead of \;. This only works for some commands but using + will build and run a much more efficient command. For example, if you have three files (a, b and c) in a directory and you run find -exec echo {} \; it will execute: echo a echo b echo c However, ...


1

You need to end your command with \; Try this: cd /opt/lampp/htdocs/EspoCRM-2.5.2 && find data -type d -exec chmod 775 {} \;


4

You need to mark your exec as finished with \; Your command would look like: cd /opt/lampp/htdocs/EspoCRM-2.5.2 && find data -type d -exec chmod 775 {} \; BTW: You don't need to cd into a dir. find can take a complete path where to search. So find /opt/lampp/htdocs/EspoCRM-2.5.2/data/ -type d -exec chmod 775 {} \; should also work as find call. ...


0

Kid3 can do this, example $ kid3-cli -c get jessie-ware-kind-of-sometimes-maybe-192k-aac.m4a File: MP4 192 kbps 44100 Hz 2 Channels 3:45 Name: jessie-ware-kind-of-sometimes-maybe-192k-aac.m4a Tag 2: MP4 Title Kind Of... Sometimes... Maybe Artist Jessie Ware Album ...


-1

I know this is an old thread, but I'm just learning and found these posts helpful. My best solution was to use gawk to insert spaces between the variables for you. ls -la | gawk '{print $1, $9}'


0

My favorite is pstree -p | grep $(program_name). This actually greps the process, highlights it and shows the pid in parenthesis. My next favorite (especially when programming and needing all pids from process) is pgrep -law "". This literally gives you every pid running followed by the application (with absolute path). This can be reduced to pgrep -lw "" ...


1

after a lot of investigation I found out my /tmp folder had the wrong permissions. All I had to do was setting sudo chmod -R 1777 /tmp


1

You actually CAN use the Cut/Copy/Paste-Hotkeys in a terminal: You just have to additionally use the Shift key: Copy: Ctrl+Shift+C Paste: Ctrl+Shift+V Cut: Ctrl+Shift+X Some command editing shortcuts: Delete one word: Alt+Backspace Move cusrsor one word left/right: Ctrl+←/Ctrl+→ If you want to use the Super key as a modifier, there is no ...


4

bash offers the Ctrl+Alt+e shortcut (from the bash man page): shell-expand-line (M-C-e) Expand the line as the shell does. This performs alias and history expansion as well as all of the shell word expansions. Examples: ls Ctrl+Alt+e ls -aF --color !268 Ctrl+Alt+e ps -aef $PATH Ctrl+Alt+e ...


0

I got the following error when I first used 'screen' in multi-user mode. "Must run suid root for multiuser support." Which was easily fixed by running: sudo chmod u+s /usr/bin/screen


1

You can also use synaptic package manager. Look at the buttons bottom-left corner. Choose "origin", you will see the list of PPAs on the left pane. But this also shows available package(s) (not installed). You just have to sort the packages by clicking the 'status' column (to see if the package is installed or not).


2

Bash uses special environment variables for handling arguments/parameters $0 : the scriptname itself $# : Total number of arguments $1 : first argument $2 : second argument and so on #!/usr/bin/env bash echo name of script is $0 echo first argument is $1 echo second argument is $2 echo number of arguments is $# The output of this program will ...


4

you can use script in following manner #!/bin/bash clear for var in "$@" do shred -n 3 -zvfu "$var" done Or A shorter version #!/bin/bash clear for var do shred -n 3 -zvfu "$var" done Run your script followed by the file name you want to shred. You can use multiple file separated by space.


0

This should also work: sync -arv --exclude={.ccache,build} /home/ben /media/ben/thumbdrive/


2

You can use the notify-send tool: cd $HOME touch foo echo "foo\nbar\nbaz" > foo notify-send "TEST" $(cat ~/foo) it will create a notification like the one below: Finally read How to add keyboard shortcuts? to enable Ctrl+Q for this notification (or better choose another combination as this one is already occupied - Thanks Jacob Vlijm). Update: All ...


0

After searching the web several times for some minutes, the best page I found was this: http://forum.colemak.com/viewtopic.php?id=1438 It explains the remapping of keys for keyboard layout colemark. But it can be used with QWERTY/QWERTZ, too.


0

Check your arm tool chain if it is for 64-bit or not, you can use this command: file <arm-tool-chain>/bin/arm-none-linux-gnueabi-gcc If it is not showing elf 64 bit then it won't work. Change the arm tool chain 32 bit to 64 bit.


0

first: sudo apt-get purge locales then: sudo aptitude install locales and the famous: sudo dpkg-reconfigure locales This rids the system of locales, then re-installs locales and downgrades libc6 from 2.19 to 2.13 which is the issue. Then configures locales again.


6

Suspend alias expansion You could also disable alias expansion for all aliases temporarily, without deleting them: $ shopt -u expand_aliases $ command -v ls /bin/ls To enable them: shopt -s expand_aliases $ command -v ls alias ls='ls --color=auto' Note that alias expansion is disabled by default in scripts, but set by default in interactive shells.


0

You can write a bash script without using any API. You're usage is wrong. The correct way is skype --callto +14445551234 You can view more options by typing th following command in the terminal skype --help [I have writing a script using this only.] Then you can combine the codes with a GUI and bam! You are done OR You can follow jneves' answer


30

You can bypass aliases by the following methods: the full pathname of the command: /bin/ls command substitution: $(which ls) the command builtin: command ls double quotation marks: "ls" single quotation marks: 'ls' a backslash character: \ls


4

You could add command before the aliased command, e.g. command ls Or run the original executable by combining which which ls It will return "/bin/ls", therefore with `which ls` you could execute it directly.


3

You can also run the command from its original location /bin/ls instead of ls


7

You can disable an alias using \ in front of command. So to run the original ls command you need to run it using \ls For example First creating alias of ls command. [guru@guru-Aspire-5738 /]$ alias ls='ls -l' [guru@guru-Aspire-5738 /]$ ls total 96 drwxr-xr-x 2 root root 4096 Sep 3 18:31 bin drwxr-xr-x 5 root root 4096 Sep 17 02:51 boot drwxr-xr-x ...


5

You can use gvfs-trash command from the package gvfs-bin which is installed by default in Ubuntu. Move file to trash: gvfs-trash filename See the content of the trash: gvfs-ls trash:// Empty the trash: gvfs-trash --empty


0

As others have already stated, you're missing a command. Here are some interesting combinations: cat <file1.txt >file2.txt tail <file1.txt >file2.txt head <file1.txt >file2.txt wc -l <file1.txt >file2.txt base64 <file1.txt >file2.txt base64 -D <file1.txt >file2.txt gzip -c <file1.txt >file2.txt gunzip -c ...


1

As far as I can tell, this menu-based interface is part of the installer, and does not exist independently. However, if and when Network Manager 0.9.10 comes to Ubuntu, you could use nmtui, the text user interface for Network Manager for a nicer interface. Other options include wicd-cli, part of WICD, a network management program.


6

This is explained very nicely in the relevant section of the bash manual. Briefly, anything within single quotes is interpreted literally. So, for example: $ echo '$SHELL' $SHELL $ echo '{1..3}' {1..3} Compare that to the unquoted versions: $ echo $SHELL /bin/bash $ echo {1..3} 1 2 3 Double quotes allow variable expansion (also history expansion and ...


0

echo '$HOME' is "$HOME" Single quotes prevent the variable expansion, while double quotes allow it.


1

In Ubuntu 14.04 LTS, there are at least two ways to do this. Assumptions: You want to do this for Unity (graphical environment). The goal is just to change comma to dot, not to change the whole layout or other options. Option 1: GUI (dconf-editor) Run (Alt+F2) "dconf-editor", navigate in the tree to schema "org.gnome.desktop.input-sources" and set the ...


0

From the Sublime Text Unofficial Documentation: You can create a symbolic lynk sudo ln -s /opt/Sublime\ Text\ 3/sublime_text /usr/bin/sublime. "/opt" being the dir where you installed Sublime. The Documentation also shows how to add Sublime to the Unity Launcher if you wish.



Top 50 recent answers are included