Tag Info

Hot answers tagged

19

Using find: find /tmp/ -type f -exec md5sum {} + | grep '^file_md5sum_to_match' If you searching through / then you can exclude /proc and /sys see following find command example : Also I had done some testing, find take more time and less CPU and RAM where ruby script is taking less time but more CPU and RAM Test Result Find [root@dc1 ~]# time find ...


18

{ cat sample1.txt; tail -n +4 sample2.txt; tail -n +4 sample3.txt; } > out.txt


17

Version control system is a program like any other. You can install it system-wide or locally if you like. Read the first two lines of GIT installation instructions for example. Also, if you are going to build anything to run as normal user, you might be interested in the question about running your own programs.


12

Try this: lslpp -l | grep perl perl -v


12

I usually use the -exec utility. Like this: find . -type f -exec du -a {} + I tried it both on bash and ksh with GNU find. I never tried AIX, but I'm sure your version of find has some -exec syntax. The following snippet sorts the list, largest first: find . -type f -exec du -a {} + | sort -n -r | less


11

Global paths should be set in /etc/profile or /etc/environment, just add this line to /etc/profile: PATH=$PATH:/path/to/ANT/bin


11

Script Solution #!/usr/bin/ruby -w require 'find' require 'digest/md5' file_md5sum_to_match = [ '304a5fa2727ff9e6e101696a16cb0fc5', '0ce6742445e7f4eae3d32b35159af982' ] Find.find('/') do |f| next if /(^\.|^\/proc|^\/sys)/.match(f) # skip next unless File.file?(f) begin md5sum = Digest::MD5.hexdigest(File.read(f)) ...


11

You can try to find the relevant files with find: find /usr/something -maxdepth 1 -user antoine You can then use -exec to create a zip file from the results of find: find /usr/something -maxdepth 1 -user antoine -exec zip /tmp/file.zip {} + leave out the maxdepth if you want to recurse.


10

Mono does not support AIX. If you want to try to port Mono to AIX, you would probably want to: Turn on the manual checking of dereferences in Mono, as AIX keeps the page at address zero mapped, preventing a whole class of errors from being caught. I forget the name of the define, but it was introduced some six months ago. You would have to make sure ...


10

/[ ]*/ matches zero or more spaces, so the empty string between characters matches. If you're trying to match "one or more spaces", use one of these: ... | sed 's/ */ /g' ... | sed 's/ \{1,\}/ /g' ... | tr -s ' '


9

The best way to learn AIX would be to obtain an account on a machine that's running it. Really, part of what sets AIX apart from other unices is that it's designed for high-end systems (with lots of processors, fancy virtualization capabilities and so on). You won't learn as much by running it in a virtual machine. If you really want to run AIX on your ...


9

The use of grep is redundant, sed can do the same. The problem is in the use of * that match also 0 spaces, you have to use \+ instead: iostat | sed -n '/hdisk1/s/ \+/ /gp' If your sed do not supports \+ metachar, then do iostat | sed -n '/hdisk1/s/ */ /gp'


9

perl may not be the most appropriate unless the IO::Pty module is installed. First, maybe you don't need anything complicated if the given-thing-that-takes-long-time (gtttlt) can work OK with pipes. mkfifo input nohup gtttlt <> input > output 2>&1 & to start the gtttlt (input from a named pipe, output to a regular file). Then you ...


8

Remember that each of the NFS client systems will determine the username by looking up the numerical UID locally using the local system's /etc/passwd, or in your centralized user database. The NFS server only stores the UID in numerical format, and does not know about usernames. This is also true for group names vs. GIDs. In your case, serverA and serverB ...


8

If you're going to the expense of buying IBM pSeries servers, then generally, in broad terms, you may as well run AIX on them which is specifically crafted to drive the hardware as efficiently as possible. That goes from the hypervisor down through to the adapters. If you want to run Linux, you may as well buy xSeries hardware (in IBM terms, or Intel / AMD ...


8

As recommended by IBM: use lsof -i -n and look for port XY. If you want parseable output from lsof, use the -F flag and parse the output with awk. You can get pre-compiled binaries for AIX V5. I don't know if there are pre-compiled binaries for V6; if there aren't, get the source and compile it.


8

Instead of using cat you can use tail as such: tail -c +4 FILE This will print out the entire file except for the first 3 bytes. Consult man tail for more information.


8

The weird string "@(#)" is actually used by the ancient SCCS version control system. Specifically, the what command would look through a file (binary or text) and find ASCII-Nul-terminated strings that started with "@(#)", and print that string out. That allowed you to embed printable ASCII version numbers in ".o" files and ultimately executables, so you ...


7

No real chance of getting AIX to run on your laptop, the best way to learn is to buy an old machine and have a go on real hardware (PPC hardware itself is quite different, different boot process etc). You should be able to find a cheap IBM workstation on eBay for a few hundred dollars, a model 275 with 4Gb RAM should be sufficient to run AIX for testing ...


7

sed '4,${/^---/d;/^Date/d;}' sample1.txt sample2.txt sample3.txt > out.txt


6

An update from a colleague, which I have just tested: 12arstdyfu445!! works It seems that for some legacy reason, the password strength rules need to be adhered to within the first 8 characters of the password. I will do some hunting around to see if this is applicable to all AIX and Solaris versions, but I hadn't managed to find an answer when googling ...


6

Usually uname -m should do the trick, as should arch. The output of both of these commands will tell you the architecture for which the kernel was built. Whether this is 32 or 64 bit is usually pretty clear (x86_64 and ia64 are two possible 64-bit architectures). However, note that you could have a 32-bit kernel while running on 64-bit hardware. If you ...


6

Dtrace would be nice but it's not ported on AIX. You should be able to trace what is chmoding the file with auditing: http://www.ibm.com/developerworks/aix/library/au-audit/


6

Old school — you could use dd: dd if=A_FILE bs=1c skip=3 The input file is A_FILE, the block size is 1 character (byte), skip the first 3 'blocks' (bytes). There are other ways too: sed '1s/^...//' A_FILE This works if there are 3 or more characters on the first line. tail -c +4 A_FILE And you could use Perl, Python and so on too.


6

You can use chpasswd The chpasswd command administers users' passwords. The root user can supply or change users' passwords specified through standard input. Each line of input must be of the following format. username:password Only root users can set passwords with this command. Example 1: echo username:password | chpasswd Example 2: ...


6

All you need is join join -t\, <(sort Output1.csv) <(sort Output2.csv) -or- join -t "," <(sort Output1.csv) <(sort Output2.csv) or awk awk -F, 'FNR==NR{a[$1]=$2;next}{ print $0 "," a[$1]}' Output2.csv Output1.csv


6

awk -Fy -v OFS=y '{gsub(",","u",$2); print}' file


6

Just remove the lines from the sub-directories (that assumes directory names don't have newline characters in them): du | grep -v '/.*/' or: du | awk -F/ 'NF <= 2' Note that it won't be significantly slower than GNU's du --max-depth=1 as the costly part is lstating all the files which needs to be done for both. If you can't guarantee that directory ...


6

If you decide to install gnu find anyway (and since you indicated interest in one of your comments), you can try something like: find / -type f \( -exec checkmd5 {} YOURMD5SUM \; -o -quit \) and have checkmd5 compare the md5sum of the file it gets as argument compare to the second argument and print the name if it matches and exit with 1 (instead of 0 ...


5

Yes, you are more-or-less correct on all 3 points. PowerVM is the hypervisor. It has redundant service processors that do the work of RSA cards you'd find in the intel systems. There are 3 tiers of PowerVM each providing additional functionality on the system. (More LPARs, Partition Mobility, etc) There is no operating system to manage for PowerVM. VIOs ...



Only top voted, non community-wiki answers of a minimum length are eligible