Comment by conorgriffin on Printing (saving) the last bash input command
It's not clear what you mean by 'Printing(saving)'. Where do you want the command saved to?
View ArticleComment by conorgriffin on Printing (saving) the last bash input command
the $'\033[38;5;2m' and $'\033[0m\n' parts are ANSI escape codes. The first one colors the contents of $prompt_history and the second resets the color to your terminals default.
View ArticleComment by conorgriffin on What strings should I look for in /var/log/auth.log?
Thanks Justin, I had googled some answers actually and have amended the last grep string accordingly. Thanks for the tip on cat, it's obviously time for bed ;o)
View ArticleComment by conorgriffin on Filtering on dates with grep and awk
This isn't actually working, I'll play around with it. The first section works but the piece contained in the single-quotes doesn't, even if I replace 'BREAK-IN...Illegal' with 'Jan'
View ArticleComment by conorgriffin on How can I substitute into this shell command?
Well the key part of the problem I was trying to solve was the substitution of the GID from a file into the appropriate part of the command
View ArticleComment by conorgriffin on Why is #!/usr/bin/env bash not working on my system?
I already reinstalled coreutils but that made no difference. It's pretty weird. /usr/bin/env is a symbolic link with a relative path to it's target ../../bin/env. So that should be /bin/env which also...
View ArticleComment by conorgriffin on Why is #!/usr/bin/env bash not working on my system?
This is correct, /usr/bin was moved to another file system and is a symbolic link to /vol_01/usr/bin
View ArticleComment by conorgriffin on Create tar archive of a directory, except for...
anyone seen this not work? I've tried this solution on Yosemite and when I unzip on an AIX box the PaxHeader directories are still generated
View ArticleComment by conorgriffin on How can I change directories and set bash options...
first option worked perfectly
View ArticleWhat strings should I look for in /var/log/auth.log?
I wrote a bash command to scan /var/log/auth.log for messages occurring on the current day indicating unauthorised access. Currently it just fetches messages matching BREAK-IN and unauthorized.What...
View ArticleHow can I dynamically switch the output destination of a script or command?
I ran a shell command the other day which produced more output than expected. It was writing to a file on a filesystem with very little available space and could have filled the filesystem. The command...
View ArticleFiltering on dates with grep and awk
I have created the alias below in my .bash_aliases filealias auth="grep \"$(date|awk '{print $2,$3}')\" /var/log/auth.log | grep -E '(BREAK-IN|Invalid user|Failed|refused|su|Illegal)'"This is supposed...
View ArticleHow to parse hundred html source code files in shell?
I have a couple of hundred html source code files. I need to extract the contents of a particular <div> element from each of these file so I'm going to write a script to loop through each file....
View ArticleHow can I substitute into this shell command?
I have a find command that I want to substitute a list of GIDs into.Here's the command: find / -follow \( -group 39 -o -acl_group 39 \) -exec ls -ln {} \; 2> $HOME/error.39.log 1>...
View ArticleProcessing bash variable with sed
bash variable LATLNG contains a latitude & longitude value in brackets like so (53.3096,-6.28396)I want to parse these into a variable called LAT and LON which I'm trying to do via sed like so...
View ArticleHow do I mount a WD MyBook World network drive in linux?
I have a WD MyBook World NAS on my home network. I currently use this for Time Machine backups for my Mac but I'd also like to use it as a backup location for my linux box which is running Ubuntu...
View ArticleWhat are the fundamental differences between the mainstream *NIX shells?...
What are the fundamental differences between the mainstream *NIX shells and what scenarios might prompt you to use one over the other? I understand that some of it probably comes down to user...
View ArticleHow can I change directories and set bash options when logging onto to a...
I regularly have to log onto remote hosts via SSH and I like to use the bash option set -o vi and I normally have to cd to a specific directory. Since these hosts are ephemeral (they are created and...
View ArticleWhy is #!/usr/bin/env bash not working on my system?
I ran into some issues when running some installation scripts where they complained of bad interpreter.So I made a trivial example but I can't figure out what the problem is, see below.#!/usr/bin/env...
View Article
More Pages to Explore .....