Help Me:I need to know which is the last of four files generated file are listed
Hi,
I am new in linux. And I need to know which is the last of four files generated file are listed. Of 4 o 5 files I need to know What is the last file created for linux commands? Please, Pathrosa |
run:
Quote:
|
i need the first file
Thanks eyanu,
This comand is util, but How I can get the first file the this file list? In This example: >ls -t file3.txt file2.txt file1.txt I need to get only "file3.txt" Thanks, Pathrosa |
Code:
ls -lt *.txt |head -1 http://rute.2038bug.com/index.html.gz http://tldp.org/LDP/Bash-Beginners-G...tml/index.html http://www.tldp.org/LDP/abs/html/ |
Thanks
Thanks eyanu for yu help. This commands resolved my problem.
Pathrosa |
Hi eyanu!!!
I need you help Please!. I am migrating an project of DataStage of Unix UAX to DataStage zlinux. And I have a Job that have an Stage that make an validation de unos archivos. This Stage run a script in Unix UAX, but I need migrate to zLinux. This script is the following: echo "for i in \`ls /home/carlossz/validacion/Idc_7_val_*.asc.Z\`\\ndo\\ny=\`zcat \$i|cut -d'|' -f5|sort|uniq -c|awk '{print \$1}'|sort -u|wc -l\`\\necho \"\$i \$y\"\\ndone|grep -v \" 1\"|cut -d\" \" -f1 | sed 's/^/rm -f /g' ">/home/carlossz/validacion/Idc_7_val_ArchCif.sh; sh /home/carlossz/validacion/Idc_7_val_ArchCif.sh > /home/carlossz/validacion/Idc_7_val_borraArchCif.sh This script run in Unix UAX without problems and I need run in zlinux as written, but when i run this script in zLinux I have the following error: /home/carlossz/validacion/Idc_7_val_ArchCif.sh: line 1: syntax error near unexpected token `|' /home/carlossz/validacion/Idc_7_val_ArchCif.sh: line 1: `for i in `ls /home/carlossz/validacion/Idc_7_val_*.asc.Z`\ndo\ny=`zcat $i|cut -d'|' -f5|sort|uniq -c|awk '{print $1}'|sort -u|wc -l`\necho "$i $y"\ndone|grep -v " 1"|cut -d" " -f1 | sed 's/^/rm -f /g' ' I dont know what to do.... Pathrosa |
pathrosa, could you please document your code for easy reading. Just enter your code and surround it with [QUOTE] tags.
|
Or it would be better to start another thread all together....
|
Someone, Can help me to get de substring of string, for example:
I need get substring "pruebaCuatro_prueba.txt" of "/home/carlossz/Modelo_Control/Transformaciones/Tecnologia/Modelo_control/Temporales/Ctrl_procesos_dwh/pruebaCuatro_prueba.txt" Please Help Me, Pathrosa |
Have you read those links I gave above?
Try http://linux.die.net/man/1/basename You start a new thread for new questions. |
All times are GMT -5. The time now is 06:36 PM. |