How to read long files on the shell?
There is a file named 'grub-install'
As a superuser I wrote the following: [cat 'grub-install'] I can't read the whole file. It is too long. I can't read the first part of the file. My screen is not long enough to read the first part of the file. How do I read the whole file? [root@ /]# find / -name 'grub-install' /sbin/grub-install [root@ /]# As a matter of fact the file in question is a script. I am pasting a part of it here. ---------------------------------------------------------- exit 1 fi if test "x$tmp_part" != x; then # If a partition is specified, we need to translate it into the # GRUB's syntax. case "$host_os" in linux*) echo "$tmp_drive" | sed "s%)$%,`expr $tmp_part - 1`)%" ;; gnu*) if echo $tmp_part | grep "^s" >/dev/null; then tmp_pc_slice=`echo $tmp_part \ | sed "s%s\([0-9]*\)[a-g]*$%\1%"` tmp_drive=`echo "$tmp_drive" \ | sed "s%)%,\`expr "$tmp_pc_slice" - 1\`)%"` fi if echo $tmp_part | grep "[a-g]$" >/dev/null; then tmp_bsd_partition=`echo "$tmp_part" \ | sed "s%[^a-g]*\([a-g]\)$%\1%"` tmp_drive=`echo "$tmp_drive" \ | sed "s%)%,$tmp_bsd_partition)%"` fi |
you've not discovered the "less" command yet? or more? or vi? or emacs? or pico? or nano? 1,000+ posts? :confused:
less grub-install you've probably no reason to want to read it though, i doubt you'd understand it. i doubt i'd find it exactly easy... |
Thanks acid kewpie
I like your humour. Though I have posted thousands of questions I don't know 'less' ! You are correct. There are many things in UNIX which I don't know. The reason is my idiocy! |
I more or less know more or less nothing about more or less too.
:scratch: :D |
type [cat 'grub install'] | less
|
Yep, there are more and less. More is actually less than less, meaning less is more than more. But there also is most, has anybody tried it?
|
Which is more? Most or less? No, which is a different thing altogether.
|
this is just confusing now :S
|
From http://www.slackbook.org/html/file-commands-pagers.html
Quote:
|
Quote:
truthfatal, that quote is hilarious! |
Does that quote from Joost Kremers make it:
A: Less confusing? :scratch: B: More confusing? :scratch: :scratch: C: Most confusing? :scratch: :scratch: :scratch: |
Yeah I use 'most' - it has colours :0)
|
Quote:
|
All times are GMT -5. The time now is 07:02 AM. |